Intersoft ClientUI Documentation
CanQueryStatusRoutedEventHandler Delegate
See Also  Send Feedback
Intersoft.Client.Framework.Input Namespace : CanQueryStatusRoutedEventHandler Delegate






sender
The source of the event.
e
A CanQueryStatusRoutedEventArgs that contains the event data.
Represents the method that will handle the CanQueryStatus events for commands.

Syntax

Visual Basic (Declaration) 
Public Delegate Sub CanQueryStatusRoutedEventHandler( _
   ByVal sender As Object, _
   ByVal e As CanQueryStatusRoutedEventArgs _
) 
Visual Basic (Usage)Copy Code
Dim instance As New CanQueryStatusRoutedEventHandler(AddressOf HandlerMethod)
C# 
public delegate void CanQueryStatusRoutedEventHandler( 
   object sender,
   CanQueryStatusRoutedEventArgs e
)
Delphi 
public delegate CanQueryStatusRoutedEventHandler( 
    sender: TObject;
    e: CanQueryStatusRoutedEventArgs
);
JScript 
public delegate CanQueryStatusRoutedEventHandler( 
   sender : Object,
   e : CanQueryStatusRoutedEventArgs
)
Managed Extensions for C++ 
public: __gc __delegate void CanQueryStatusRoutedEventHandler( 
   Object* sender,
   CanQueryStatusRoutedEventArgs* e
)
C++/CLI 
public delegate void CanQueryStatusRoutedEventHandler( 
   Object^ sender,
   CanQueryStatusRoutedEventArgs^ e
)

Parameters

sender
The source of the event.
e
A CanQueryStatusRoutedEventArgs that contains the event data.

Remarks

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.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.