'Declaration Public Shared ReadOnly Property ApplyRecommendedValueCommand As RoutedUICommand
'Usage Dim value As RoutedUICommand value = GcMask.ApplyRecommendedValueCommand
public static RoutedUICommand ApplyRecommendedValueCommand {get;}
'Declaration Public Shared ReadOnly Property ApplyRecommendedValueCommand As RoutedUICommand
'Usage Dim value As RoutedUICommand value = GcMask.ApplyRecommendedValueCommand
public static RoutedUICommand ApplyRecommendedValueCommand {get;}
When recommended value is "123456789" and FieldSet is "\D{3}-\D{6}", this command makes GcMask apply the value. The default key gesture for this command is Ctrl+Enter.
If FieldSet doesn't contain any field, the recommended value will not be shown and the ApplyRecommendedValueCommand execution will do nothing either.
Recommended value has lower priority than watermark. When watermark is shown, the recommended value is not shown any more, but the ApplyRecommendedValueCommand still works in this case.
The following example shows how to hook up a System.Windows.Input.RoutedCommand to a InputMan Control.
InputMan controls provides a library of commands which application programmers encounter regularly. The classes which comprise the command library are: FieldsEditingCommands, CalendarCommands and ControlNavigationCommands. And some commands are defined in some controls class.
Many controls in InputMan do have built in support for some of the commands in the command library. GcTextBox, for example, supports many of the application edit commands such as System.Windows.Input.ApplicationCommands.Paste, System.Windows.Input.ApplicationCommands.Copy, System.Windows.Input.ApplicationCommands.Cut, and System.Windows.Input.ApplicationCommands.Undo. The application developer does not have to do anything special to get these commands to work with these controls. If the GcTextBox is the command target when the command is executed, it will handle the command using the System.Windows.Input.CommandBinding that is built into the control.
The following shows how to use System.Windows.Input.KeyBinding as the command source for the command defined on GcMask, where a GcMask is the target of the command. All the logic that defines how the GcMask performs the operations is built into the GcMask control.