Intersoft.Client.Framework.Input Namespace : QueryStatusRoutedEventArgs Class |
Public NotInheritable Class QueryStatusRoutedEventArgs Inherits Intersoft.Client.Framework.ISRoutedEventArgs
Dim instance As QueryStatusRoutedEventArgs
public sealed class QueryStatusRoutedEventArgs : Intersoft.Client.Framework.ISRoutedEventArgs
public ref class QueryStatusRoutedEventArgs sealed : public Intersoft.Client.Framework.ISRoutedEventArgs
Hybrid routed command is built on the top of routed command model that supports the commanding semantics such as the command, the command source, the command target, and the command binding. In addition, hybrid routed command exposes its own classes and object model to support additional features which includes HybridRoutedCommand, HybridCommandManager and a HybridCommandBinding class.
The HybridRoutedCommand class is derived from RoutedUICommand, and extended with IHybridCommand interface which expose two members, CanQueryStatus and QueryStatus. The hybrid command model introduces status querying capability in addition to the execute query. The status query is particularly useful for scenarios that require an alternate user interface state such as a toggle button in text editor.
Using the text editor scenario as an example, the editing commands such as Bold and Italic should become checked or unchecked based on the current selection in the text editor. This behavior is added on top of the automatic state synchronization whereby the editing commands should become disabled if there is no selection in the text editor.
Hybrid routed command model is designed to address this particular requirements which makes it easier and simple to implement the alternate state query mechanism using the commanding semantics. For more information about the status query concept, see Hybrid Commands.
The following code example shows the event handler for CanQueryStatus and QueryStatus routed event for the HybridCommandBinding associated to the Bold command.
C# |
Copy Code
|
---|---|
private void BoldCmdCanQueryStatus(object sender, CanQueryStatusRoutedEventArgs e) { e.CanQueryStatus = true; } private void BoldCmdQueryStatus(object sender, QueryStatusRoutedEventArgs e) { if (e.Command == EditingCommands.Bold) { // notifies the current bold status to the command source // that bound to the Bold command. e.QueryParameter.Value = (FontWeight)textBox1.Selection. GetPropertyValue(Run.FontWeightProperty) == FontWeights.Bold; } } |
For a more complete version of the above example, see How-to: Implement a HybridRoutedCommand.
System.Object
System.EventArgs
System.Windows.RoutedEventArgs
Intersoft.Client.Framework.ISRoutedEventArgs
Intersoft.Client.Framework.Input.QueryStatusRoutedEventArgs
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2