Class MouseCommands
This class is used to add bindable MouseBinding values to the UIElement.InputBindings collection. Despite MouseBinding deriving from DependencyObject, the CommandParameter property on a MouseBinding is not a DependencyProperty. In addition, if CommandParameter were a DependencyProperty bindings would not succeed because the WPF inheritance context for bindings does not extend through the InputBindings collection, making it impossible for the source of the binding to be determined. The MouseCommands helper class works around this problem by using attached DependencyProperties on the UIElement and forwarding those values to a single MouseBinding instance in that UIElement's InputBindings collection. This effectively reduces the number of MouseBindings on a UIElement to one when used, since the PropertyChanged handlers iterate through the InputBindings and modify the first MouseBinding found. However, it does allow bindability on the CommandParameter.
Inherited Members
Namespace: Phoenix.Aruba
Assembly: Phoenix.Plugin.Aruba.dll
Syntax
public static class MouseCommands
Fields
View SourceControlMouseCommandParameterProperty
The ControlMouseCommandParameter attached dependency property.
Declaration
public static readonly DependencyProperty ControlMouseCommandParameterProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ControlMouseCommandProperty
The ControlMouseCommand attached dependency property.
Declaration
public static readonly DependencyProperty ControlMouseCommandProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
MouseCommandActionProperty
The MouseCommandAction attached dependency property.
Declaration
public static readonly DependencyProperty MouseCommandActionProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
MouseCommandParameterProperty
The MouseCommandParameter attached dependency property.
Declaration
public static readonly DependencyProperty MouseCommandParameterProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
MouseCommandProperty
The MouseCommand attached dependency property.
Declaration
public static readonly DependencyProperty MouseCommandProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ShiftMouseCommandParameterProperty
The ShiftMouseCommandParameter attached dependency property.
Declaration
public static readonly DependencyProperty ShiftMouseCommandParameterProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ShiftMouseCommandProperty
The ShiftMouseCommand attached dependency property.
Declaration
public static readonly DependencyProperty ShiftMouseCommandProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Methods
View SourceGetControlMouseCommand(DependencyObject)
Gets the control mouse command.
Declaration
public static ICommand GetControlMouseCommand(DependencyObject d)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
Returns
| Type | Description |
|---|---|
| ICommand | The control mouse command. |
GetControlMouseCommandParameter(DependencyObject)
Gets the control mouse command parameter.
Declaration
public static object GetControlMouseCommandParameter(DependencyObject d)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
Returns
| Type | Description |
|---|---|
| object | The control mouse command parameter. |
GetMouseCommand(DependencyObject)
Gets the mouse command.
Declaration
public static ICommand GetMouseCommand(DependencyObject d)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
Returns
| Type | Description |
|---|---|
| ICommand | The mouse command. |
GetMouseCommandAction(DependencyObject)
Gets the mouse command action.
Declaration
public static MouseAction GetMouseCommandAction(DependencyObject d)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
Returns
| Type | Description |
|---|---|
| MouseAction | The mouse command action. |
GetMouseCommandParameter(DependencyObject)
Gets the mouse command parameter.
Declaration
public static object GetMouseCommandParameter(DependencyObject d)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
Returns
| Type | Description |
|---|---|
| object | The mouse command parameter. |
GetShiftMouseCommand(DependencyObject)
Gets the shift mouse command.
Declaration
public static ICommand GetShiftMouseCommand(DependencyObject d)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
Returns
| Type | Description |
|---|---|
| ICommand | The shift mouse command. |
GetShiftMouseCommandParameter(DependencyObject)
Gets the shift mouse command parameter.
Declaration
public static object GetShiftMouseCommandParameter(DependencyObject d)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
Returns
| Type | Description |
|---|---|
| object | The shift mouse command parameter. |
SetControlMouseCommand(DependencyObject, ICommand)
Sets the control mouse command.
Declaration
public static void SetControlMouseCommand(DependencyObject d, ICommand value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
| ICommand | value | The value. |
SetControlMouseCommandParameter(DependencyObject, object)
Sets the control mouse command parameter.
Declaration
public static void SetControlMouseCommandParameter(DependencyObject d, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
| object | value | The value. |
SetMouseCommand(DependencyObject, ICommand)
Sets the mouse command.
Declaration
public static void SetMouseCommand(DependencyObject d, ICommand value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
| ICommand | value | The value. |
SetMouseCommandAction(DependencyObject, MouseAction)
Sets the mouse command action.
Declaration
public static void SetMouseCommandAction(DependencyObject d, MouseAction value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
| MouseAction | value | The value. |
SetMouseCommandParameter(DependencyObject, object)
Sets the mouse command parameter.
Declaration
public static void SetMouseCommandParameter(DependencyObject d, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
| object | value | The value. |
SetShiftMouseCommand(DependencyObject, object)
Sets the shift mouse command.
Declaration
public static void SetShiftMouseCommand(DependencyObject d, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
| object | value | The value. |
SetShiftMouseCommandParameter(DependencyObject, object)
Sets the shift mouse command parameter.
Declaration
public static void SetShiftMouseCommandParameter(DependencyObject d, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The dependency object. |
| object | value | The value. |