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






Provides data for the QueryStatus routed event.

Object Model

QueryStatusRoutedEventArgs Class

Syntax

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

Remarks

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.

Inheritance Hierarchy

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

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.