Intersoft ClientUI Documentation
CanQueryStatusRoutedEventArgs Class
Members  See Also  Send Feedback
Intersoft.Client.Framework.Input Namespace : CanQueryStatusRoutedEventArgs Class






Provides data for the CanQueryStatus routed event.

Object Model

CanQueryStatusRoutedEventArgs Class

Syntax

Visual Basic (Declaration) 
Public NotInheritable Class CanQueryStatusRoutedEventArgs 
   Inherits Intersoft.Client.Framework.ISRoutedEventArgs
Visual Basic (Usage)Copy Code
Dim instance As CanQueryStatusRoutedEventArgs
C# 
public sealed class CanQueryStatusRoutedEventArgs : Intersoft.Client.Framework.ISRoutedEventArgs 
Delphi 
public class CanQueryStatusRoutedEventArgs = class(Intersoft.Client.Framework.ISRoutedEventArgs)sealed; 
JScript 
public sealed class CanQueryStatusRoutedEventArgs extends Intersoft.Client.Framework.ISRoutedEventArgs
Managed Extensions for C++ 
public __gc __sealed class CanQueryStatusRoutedEventArgs : public Intersoft.Client.Framework.ISRoutedEventArgs 
C++/CLI 
public ref class CanQueryStatusRoutedEventArgs sealed : public Intersoft.Client.Framework.ISRoutedEventArgs 

Remarks

HybridCommandManager exposes CanQueryStatus routed event to provide a mechanism to determine whether a command can query the status of its command target. The instance CanQueryStatus event is also available in the HybridCommandBinding class. The CanQueryStatus routed event sent a CanQueryStatusEventArgs as the event data when the routed event is raised.

The event data in CanQueryStatusEventArgs contains three main properties:

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.

Inheritance Hierarchy

System.Object
   System.EventArgs
      System.Windows.RoutedEventArgs
         Intersoft.Client.Framework.ISRoutedEventArgs
            Intersoft.Client.Framework.Input.CanQueryStatusRoutedEventArgs

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.