Skip Navigation LinksActipro Software / Products / .NET Controls / WPF / Editors / Feature Tour

Editors Controls

Parts-based Editor Controls

Parts-based editors uses individual controls, called parts, to present and modify discreet values in an associated object or objects. Several default implementations are provided for common .Net types, which include Brush, Color, DateTime, Double, Enum, Guid, Int32, Int32Rect, Point, Rect, Size, TimeSpan, and Vector.

In addition, the framework can be leveraged to build parts-based editors for any custom types.

MaskedTextBox Control

The MaskedTextBox control can be used to restrict user input to a predefined regular expression mask. Any characters that do not match the regular expression are discarded. Distinctive prompts indicate where input is required and literal characters are automatically displayed and inserted when possible.

MonthCalendar Control

MonthCalendar can be used to select one or more dates, with support for custom logic (e.g. exclude weekends from selection). There are four view levels (Month, Year, Decade, and Century) which use smooth zoom in/out animations and allow the end-user to quickly navigate around.

AnalogClock Control

The AnalogClock control can be used to present, and interatively update, the time portion of a DateTime. Optionally show the second hand and/or tick marks for minutes.

EnumListBox Control

The EnumListBox control can be used to quickly present the values of an enumeration in a list box. Intuitive selection for all enumerations, including enumeration types marked as flags. Supports display of enumeration name or a user-friendly string using a description attribute.

Parts-based Editor Features

Extensibility

Several type-specific implementation of the parts-based editor are provided and include the following .Net types:

  • System namespace
    • DateTime
    • Double
    • Enum
    • Guid
    • Int32
    • TimeSpan
  • System.Windows namespace
    • Int32Rect
    • Point
    • Rect
    • Size
    • Vector
  • System.Windows.Media namespace
    • Brush
    • Color

These controls can be used as-is or as the basis for a custom control. In addition, you can build a parts-based editor for any custom types you may have using the existing framework. An example of this is included in our Sample Browser.

Default and Custom Items

Each type-specific implementation of the parts-based editor includes several default items, such as a drop-down button (like in a ComboBox) and spinner buttons. The default items also include any underlying parts/groups which are used to present and modify the associated value. In addition to these default items, any number of custom items can be added, through XAML or a code-behind file. Custom items are intermixed with the default items, and their order can be quickly and easily customized. This allows you to insert a custom item before or after any of the default items as needed.

A DateTimeEditBox with a custom delete button to the left of the drop-down button

Null Values

All type-specific parts-based editors support null values, with value-types leveraging the Nullable class. A null CheckBox is included as a default item, which can be used by the end-user to set the associated value to null. In addition, an initial value can be specified which is used to initialize the associated value from null, when the end-user checks the associated CheckBox or enters a value in an associated part.

Special null content, also known as a watermark, can be displayed when the associated value is null. This content is fully customizable through the use of a DataTemplate or DataTemplateSelector. This allows you to include controls, such as buttons or images, or to handle certain events, such as mouse hover.

A GuidEditBox with it's default null content displayed

Drop-down Button

A drop-down button can be included, which works much like the drop-down button of a ComboBox. The drop-down button can be used by the end-user to show or hide customizable drop-down content. The Brush, Color, and DateTime parts-based editors include default drop-down content, which uses an appropriate control (e.g. the DateTime uses MonthCalendar and/or AnalogClock). You can either use the default drop-down content as-is, or tune it to your needs.

A ColorEditBox with it's default drop-down content displayed

Format Strings

Most of the type-specific parts-based editors provided include support for format strings, which allow you to quickly configure the look and feel of the control. For example, the DateTime parts-based editor fully supports both the standard and custom format strings of the DateTime type. This allows you to set the format to "d" to only display the parts for the date portion, or you can use the format "t" to only show the time.

A DateTimeEditBox with the custom format string "dd/MM/yy 'at' hh:mm"

Spinner Buttons

Nearly all of the parts provided can have their associated value incremented or decremented, using the default spinner buttons or by using the up/down arrow keys. The Int32 and Double parts-based editors also provide a step value, which is used when incrementing or decrementing. By default, the step value is 1, but can be customized as needed.

Minimum/Maximum Values

Minimum and maximum values can be specified for most of the type-specific parts-based editors. For integral types, such as DateTime, Int32, and Double, the meaning and use of the minimum and maximum values is obvious. For aggregate types, such as Point, Rect, and Size, the minimum and maximum values can be used to restrict the individual parts. For example, using a minimum of "0,-10" and a maximum of "10,0" will restrict the X value to the range 0 through 10 and the Y value to the range -10 through 0.

MaskedTextBox Features

Mask

Input into a MaskedTextBox is restricted to a specified regular expression mask. If the user types any characters that would violate the regular expression, then it will be ignored. If the character(s) does not violate the regular expression, then it is added. The regular expression can include alternations (e.g. "(One|Two)") and/or quantifiers (e.g. "\d*"), which makes it extremely flexible.

Prompts

One or more prompts can be displayed when additional input is required. Any character or Geometry can be used for prompting, giving you full control over the look of your control. You have complete control over the brush used to render the prompts and when they are rendered (always, only when the control has focus, or never).

A MaskedTextBox with a default and custom Geometry prompt, and underscore character prompt

Custom validation

When the regular expression is not sufficient, you can apply custom validation or value coercion. The TextChanging event allows the underlying text to be checked and/or altered before it is committed. In fact, many of the parts-based editors leverage this functionality to ensure valid data is entered.

MonthCalendar Features

Selection

Several selection modes are supported, which mimic the feel of the ListBox selection modes. Single selection allows only one date to be selected at a time, and the selection follows the focused date. Multiple selection allows several non-contiguous dates to be selected without having to hold down the Control and/or Shift keys. Extended selection works like single selection, but allows additional dates to be included by hold down the Control and/or Shift keys. Finally, Range selection works like Extended but requires the selected dates to be contiguous (not counting disabled dates).

Additional selection logic can be implemented by handling the SelectionChanging event, or you can cancel the selection change all together.

A MonthCalendar with two ranges selected using the Extended mode

Disabled Dates

The selection can be restricted to certain dates using several options. A minimum and maximum date can be specified, thus disabling any dates outside the given range. This also has the effect of preventing the end-user from navigating outside the specified range.

Individual days of the week can be disabled, thus preventing them from being selected. This allows you to prevent weekends from being selected (e.g. Saturday and Sunday). In addition, individual dates or ranges can be disabled as needed.

Custom Item Styles

Each item of the MonthCalendar control can have a custom Style applied to it. In addition, a StyleSelector can be used for more complex logic such as making the text of odd numbered Tuesdays bold. Styles can also be applied to month items, year items, etc, so you are not limited to just the day items.

Custom styles for specific days

Interoperability

PropertyGrid Interop

The Actipro Editors controls can be easily integrated into the Actipro PropertyGrid using a special Interop assembly. The Interop assembly provides several default property editors, which are used by the PropertyGrid control to associate a control (or DataTemplate) with one or more properties. Samples are included that show how to accomplish this, or to build your own custom property editors.

A PropertyGrid control with the BrushEditBox integrated using the Interop assembly

Ribbon Interop

The controls provided by the Editors product can be easily integrated into the Actipro Ribbon using a special Interop assembly. The Interop assembly provides Ribbon compatible styles for the Editors controls, which allows them to blend in seemlessly with the existing Ribbon controls.

A Ribbon control that has several Editors controls in its groups

DataGrid Interop

The controls provided by the Editors product can be easily integrated into Microsoft's WPF DataGrid using a special Interop assembly. The Interop assembly provides several custom DataGridColumn objects, which are used by the WPF DataGrid control to associate a control with a column. Samples are included that show how to use the controls provided by the Editors product with the WPF DataGrid.

DataGrid with Editors integrated using the Interop assembly

General Features

Themes

This product includes 9 distinct built-in themes and is fully extensible so that other product themes can be custom developed. Themes can be tinted towards any color or set of colors, and brush resources from them may be reused.

The MonthCalendar control with Aero, Luna (Olive), and Office 2007 (Blue) themes

Right-to-left and Localization

All the Editors controls support right-to-left layouts and all text in the user interface may be localized to other languages.

XBAP Support

Editors fully supports use in XBAPs (browser applications). We have specifically engineered it to operate within the bounds of the XBAP security sandbox.

Extensive Documentation and Samples

Actipro has spent a lot of time refining the design of Editors to take advantage of WPF best practices. We realize that a good product is only part of the equation though and have also worked very hard to write detailed documentation on the product. In addition to that, Editors ships with the full source for many QuickStart examples that each focus on learning a specific feature.


Try a live online demo