Intersoft.Client.Framework.Input Namespace : CanQueryStatusRoutedEventHandler Delegate |
Public Delegate Sub CanQueryStatusRoutedEventHandler( _ ByVal sender As Object, _ ByVal e As CanQueryStatusRoutedEventArgs _ )
Dim instance As New CanQueryStatusRoutedEventHandler(AddressOf HandlerMethod)
public delegate void CanQueryStatusRoutedEventHandler( object sender, CanQueryStatusRoutedEventArgs e )
public delegate void CanQueryStatusRoutedEventHandler( Object^ sender, CanQueryStatusRoutedEventArgs^ e )
The CanQueryStatusRoutedEventHandler determines if the command associated with the event source is able to query the status on the command target. When a command is determined to support query status, you set the value of the CanQueryStatus property in the event data to true. The QueryStatus event will be raised according to the value of the CanQueryStatus property.
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 complete example of how to implement a hybrid routed command, see How-to: Implement a HybridRoutedCommand.
For more information about hybrid command concept, see Hybrid Commands.
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