The Actipro Blog

All the latest UI control development news from Actipro

SyntaxEditor - ASP-Style Server Tags with IntelliPrompt

PostBannerSyntaxEditorDevNotes

We've had a lot of customers throughout the years ask us for a sample that could show how to harness our SyntaxEditor .NET Languages Add-on and its automated IntelliPrompt within an ASP-style server tag context.  This is especially useful for any sort of template generating scenario.

We had an internal sample that we would send customers upon request, but several months back, we cleaned it up, enhanced it, and added it as a new QuickStart sample.  In this post, let's have a look at the QuickStart sample that was added to the SyntaxEditor for (WPF, Silverlight, and WinRT/XAML platforms) in the 2014.2 version showing how to achieve automated IntelliPrompt within ASP-style server tags.

Usage Example

In the animated presentation below, you can see how there is a basic parent language whose lexer only knows to tokenize and color the word "date" as a keyword.  In real-world usage, the lexer could be made to fully colorize the text like normal.  The lexer has hooks that cause a transition to the C# language found in our .NET Languages Add-on when ASP-style delimiters are encountered.

SyntaxEditorServerTags

Both <% %> and <%= %> style tags are shown in this example.  What happens behind the scenes is that the parent language's parser will code generate C# code.  It will make a C# class named "__Generated" and a method named "__WriteOutput".  All the text of the parent language is output within "Response.Write" method calls.  C# code in the server tags is injected directly.  The resulting full C# code is placed in a separate in-memory document and parsed.  Finally the resulting parse data is returned, along with mapping data to know how offsets between the server tag range in the source document and those in the parsed C# document align.

Then there are several customized C# IntelliPrompt providers that know how to use that mapping data and translate offsets so that automated IntelliPrompt is fully functional within the server tag regions of the main source document, yet based on the generated C# code.

Tricky stuff, but it works great!

Summary

The full source sample described above was added in the first v2014.2 release of our WPF, Silverlight, and WinRT/XAML controls and is available for you to check out.

TaskDownload TaskLiveDemo TaskBuyNow

Filed under: Actipro, WPF, Silverlight, WinRT

SyntaxEditor - XML End Tag Completion

PostBannerSyntaxEditorDevNotes

Let's have a look at a new feature that came to the advanced XML language for SyntaxEditor for WPF (via its Web Languages Add-on) in the latest 2014.2 maintenance release: the ability to auto-complete XML end tags.

Feature Description

The advanced XML language already has auto-end tag insertion features that occur as you type the > character at the end of a start tag.  In that scenario, the end tag is inserted immediately after the caret.  There are other times where you have deleted some text that may include an end tag that you wish to type back in again.

Say that you are editing a block of XML and start to type an end tag.  After typing the < character, the completion list will contain an item for closing the nearest open ancestor element (if any):

SyntaxEditorEndTagAutoComplete1

In the example above, you can see the "/colors" item in the completion list and how selecting it auto-completes the end tag.

End tag auto-completion also works if you put the caret after a </ and press Ctrl+Space, as in this example:

SyntaxEditorEndTagAutoComplete2

In the example above, Ctrl+Space is pressed at the caret's location to auto-complete the "colors>" text.

Summary

The features described above were added in the latest v2014.2 maintenance releases of our WPF Controls and are available for use.

TaskDownload TaskLiveDemo TaskBuyNow

Filed under: Actipro, WPF

SyntaxEditor - Read-Only Regions

PostBannerSyntaxEditorDevNotes

In today's post I'd like to show a new feature that was added to SyntaxEditor (WPF, Silverlight, and WinRT/XAML platforms) in its latest 2014.2 maintenance release: read-only regions.

Feature Description

SyntaxEditor documents have always had the ability to be fully read-only and developers can also can cancel specific text change events for more fine-grained control. That being said, there are many cases where developers want to have an easy way to tell SyntaxEditor that a certain of text should not be editable by the end user.  That's where read-only regions come into play.

SyntaxEditorReadOnlyRegion

Read-only regions are implemented using our powerful tagging mechanism.  There is a new IReadOnlyRegionTag interface (with related ReadOnlyRegionTag implementation class) that can be used to mark read-only regions.  Getting going is as easy as tagging a text range using an instance of that class.

Best of all, the ReadOnlyRegionTag class also implements IClassificationTag, which associates the tag with a classification type for read-only text and gets styled with a silver background.  Of course this is fully customizable if you wish to have a different appearance, or no appearance difference at all.

When the end user attempts to edit anything that would cross within a read-only range, the text change will realize that it intersects a read-only range and will cancel.  The text range protected by the read-only region remains unchanged.

This is a very handy feature for certain scenarios and was highly requested by our customers.

Summary

The read-only region features described above were added in the latest v2014.2 maintenance releases of our WPF, Silverlight, and WinRT/XAML controls and are available for use.

TaskDownload TaskLiveDemo TaskBuyNow

Filed under: Actipro, WPF, Silverlight, WinRT

Actipro Blog 2014 Q4 Posting Summary

BlogSummaryBlogPostBanner

What We Accomplished

In this quarter, we published large maintenance releases for the 2014.2 versions of our WPF, Silverlight, WinRT/XAML, and WinForms controls.  These versions included several new controls and some big feature enhancements for our existing controls.  Check out the release posts for more detail.

What’s Coming Next

We've started work on our 2015.1 versions of our controls.  These will feature some new controls, major improvements to our SyntaxEditor Python Language Add-on, and many other updates.  One thing we're working on is rewriting much of the core of our Docking/MDI for WPF product so that we can support even more advanced features found in the latest IDEs.

Blog Post List

Control Product Development

Tags:

WinForms Controls 2014.1 Build 322 Released

WinForms322BlogPostBanner

WinForms Controls 2014.1 build 322 has been released and is now available for download.

See the announcement post for the detailed list of enhancements and updates.

TaskDownload TaskBuyNow

Tags:

WPF, Silverlight, and WinRT/XAML v2014.2 Maintenance Releases

20142MaintReleaseBlogPostBanner

New maintenance of the 2014.2 versions of our WPF, Silverlight, and WinRT/XAML controls have been released and are now available for download.

Major new features are described below.  See the announcement posts for the detailed list of enhancements and updates, including many items not listed below:

ProductHeadingGenericEditors

ISO 3166-1 Alpha-3 Codes Added (WPF, WinRT only)

The Country class, which contains ISO country data and is utilized by our CountryComboBox control, now also includes the 3-character alpha code data for each country.

CountryComboBox

This is in addition to the existing data of 2-character alpha code and name.

ProductHeadingGenericPropertyGrid

Handling of Root Objects Improved (WPF only)

We've improved how the PropertyGrid handles properties on the root SelectedObjects that have a custom type converter.

Handling of Immutables Improved (WPF only)

We've also improved support for handling immutable objects and determining how to interact with their properties.

Custom Factory Sample Updated (WPF only)

The Custom Factory sample has been updated to show a property with a non-string type.

PropertyGridCustomFactorySample

This is a great example of showing how to implement a custom data factory and merge properties from various object sources.

ProductHeadingGenericRibbon

Backstage Tab Navigation Improved (WPF only)

We've improved keyboard navigation in the TaskTabControl control, which is generally used within Backstage tabs.

Contextual Tab Layout Refined (WPF only)

The logic for the sizing of contextual tab groups and their tabs always has had some minor issues when resizing the containing window to be thinner.  The issue didn't often manifest itself unless multiple contextual tab groups were displayed.

RibbonContextualTabs

We spent a while tracking these issues down and fixing them so that all layout sizing is now perfect, as seen in the screenshot above.

ProductHeadingGenericSyntaxEditor

Read-Only Regions Added

We've added support for read-only regions of text via the new IReadOnlyRegionTag tag.  This feature has been highly requested by customers, so we're happy to deliver it.

SyntaxEditorReadOnlyRegion

There is a ReadOnlyRegionTag implementation class that supports classification so that read-only regions can be rendered with an alternate background, such as gray in the screenshot above.  A new Read-Only Regions QuickStart that demos the new features is now in the Sample Browser.

Move Selected Lines Up/Down Commands

Another highly-requested set of commands for moving the selected lines up (via Alt+Up) and down (via Alt+Down) have been added.  The SDI Editor demo's menu has been updated to show off the new editor commands.

IntelliPrompt Completion Performance Enhancements

We did a lot of performance profiling related to IntelliPrompt completion lists and we able to make numerous performance enhancements in the areas of item matching and filtering.  These enhancements will really help performance when displaying large completion lists.

Drag and Dropped Text Reselection Option Added (WPF only)

A SyntaxEditor.IsDragDropTextReselectEnabled property has been added that can be set to false to prevent reselection of dropped text.

Data Binding Change Scroll Behavior

Views have been updated so that text changes from a data bound source (such as view model) don't scroll the view back to the first line on each update.

Line Commenter Updated

The line commenter has been updated to improve how line comment and uncomment features affect selection.  The logic that gets activated by the LineBasedLineCommenter.CanCommentEmptyLines property also has been improved.

Bi-Di Text Caret Movement (WPF only)

We've made several improvements to caret movement when editing bi-directional text.

Better Separation of UI/Document Models

All of the event ties between the UI and document models have been changed to use weak events.

.NET Languages Add-on

The ability to resolve references to nested types has been improved.

Web Languages Add-on

A completion item for closing the nearest open ancestor element, if any, has been added.  (WPF only)

SyntaxEditorCloseTagCompletion

Ctrl+Space after an end tag start delimiter will also auto-complete the matching start tag's name.  (WPF only)

We've also improved the editing experience when typing to not affect outlining nodes as much.

ProductHeadingGenericShared

Wave and ZigZag Shapes Added

New primitive shapes have been added that can be used to create some interesting user interface elements in your apps.  The Wave shape renders a wavy line.  The ZigZag shape renders a zig-zag line.ZigZag2The Shapes QuickStart has been updated with examples showing usage of the new shapes.

TaskDownload TaskLiveDemo TaskBuyNow

Fun With Shapes - ZigZag

BlogPostBanner20142Tips

In the 2014.2 versions of our controls for the WPF, Silverlight, and WinRT/XAML platforms we've been adding several new shape controls to our Shared Library that can be very handy in setting up unique interfaces in your apps.

Yesterday's post examined the new Triangle shape.  For today's post, we'll take a look at a new ZigZag shape that is coming in the next 2014.2 maintenance release.

Introduction

The zig-zag shape renders straight lines that cross from one edge of the shape to the other, and back again.  The apex side and the number of apexes to render can be specified.  It's also possible to set whether the "inside" (fill) of the shape is inverted, or moved to the other side of the apexes.

ZigZag1

Standard fill and stroke properties can be used to give the shape varied appearances.  The example on the right above is particularly interesting because it shows how an "inverted" zig-zag provides the left side of the red ribbon.  It is aligned next to a rectangle (behind the "New!") text, which allows it to generate a complex composited shape.

Advanced Usage

Zig-zag shapes are great for use when content requires a separator.ZigZag2Instead of always using a linear horizontal or vertical rule to separate content, the zig-zag shape adds some variety to the user interface.

Summary

Although shapes like zig-zags are small primitive controls, they can be very helpful in creating modern interesting user interfaces that don't rely purely on squares and rectangles.

You will be able to use our ZigZag class once the next maintenance releases of our 2014.2 WPF, Silverlight, and WinRT/XAML controls are published.

TaskDownload TaskLiveDemo TaskBuyNow

Fun With Shapes - Triangle

BlogPostBanner20142Tips

In the 2014.2 versions of our controls for the WPF, Silverlight, and WinRT/XAML platforms we added several new shape controls to our Shared Library that can be very handy in setting up unique interfaces in your apps.

For this post, we'll take a look at a new Triangle shape.  Incidentally this shape is used in the MicroTrendIndicator control we recently added to our Micro Charts controls.

Introduction

The triangle shape is a basic triangle that will fill the area you give it.  You use an enumeration to set which side the apex (point) of the triangle is on.

Triangle1

Standard fill and stroke properties can be used to give the shape varied appearances.

Advanced Usage

While a triangle shape standalone might not be very interesting, when it's combined seamlessly into other UI, it can make for some very nice presentations.

Triangle2

In this usage scenario, we use the triangle shape to help build a touch-friendly sort of breadcrumb control.

Triangle3

Here's another breadcrumb usage scenario but in this case, a smaller centered triangle is used to divide the items.

Summary

Although shapes like triangles are small primitive controls, they can be very helpful in creating modern interesting user interfaces that don't rely purely on squares and rectangles.

You can use our Triangle class today by downloading the latest versions of our WPF, Silverlight, and WinRT/XAML controls.

TaskDownload TaskLiveDemo TaskBuyNow

How Can We Improve Docking/MDI?

PostBannerWPFControlsDevNotes

Our WPF Docking/MDI product, which provides docking tool window and multiple document interface functionality for WPF applications, is already about the most polished and full-featured product of its type on the market for the WPF platform.

DockingMetro

It supports multiple professional themes, complex hierarchies of tool windows, auto-hide, multiple MDI modes, Prism/MVVM support, nested and side-by-side dock sites, layout serialization and much more.

Looking for Your Valued Feedback

As great of a product as it is, there are a few areas we are possibly looking to improve and make the product even better.  Some of this may involve a refactoring of a lot of internal code, and as such, we wanted to come to you our users and get some feedback on what improvements you would like to see made.

The feedback could be anything from simple UI and docking functionality ideas to suggestions on improving interaction with our API.  For instance, perhaps you would like to see "pin" buttons added to tabbed documents, which is a newer feature found in Visual Studio 2013.

We would love to hear what you would like to see implemented in our WPF Docking/MDI product that isn't already in place today.

Please send your comments and thoughts to our support address with as much detail as possible and screenshots/mockups where appropriate.

Thanks for your help!

Tags: ,
Filed under: Actipro, In development

PropertyGrid Improvements and Custom Property Editors

PostBannerWPFControlsDevNotes

Our WPF PropertyGrid control is an extremely powerful way to edit the properties of any object.

Custom Property Editor Sample

While a lot of PropertyGrid usage is for basic properties such as numbers, strings, dates, etc., properties can be of any custom Type as well.  In our most recent release of the WPF controls, we created a new custom property editor sample that shows how to easily add a custom property editor for a certain Type.

PropertyGridCustomEditor

The screenshot above shows how a custom enumeration named OnOffAuto was created.  The object being edited in the PropertyGrid has several properties that are of that type.  We defined in XAML a custom template that uses our HorizontalListBox control to allow for easy selection of the options.

In the case of the Security Alarm property, we made a further customized property editor template that only shows two of the options instead of all three.  This specialized template is configured to only apply to that one specific property.

While this sample shows how to make a custom property editor for an enumeration type, the same concepts can be applied to any custom type.

Other Recent PropertyGrid Improvements

In recent builds, we have further improved the editing experience when using PropertyGrid.  We added built-in property editors for font-related properties.  We added support so that double-clicking a property name will cycle through any standard value options that the property has.  In the event that the property doesn't support standard values, double-clicking the property name will attempt to focus the related editor instead and select all text if possible.

Summary

Download the latest build of our WPF controls to see this new sample and obtain the latest editing features.

TaskDownload TaskLiveDemo TaskBuyNow

Filed under: Actipro, New features, WPF