Class Button
Implements control with Click event when pressed
Inheritance
Implements
Inherited Members
Namespace: EmptyKeys.UserInterface.Controls
Assembly: EmptyKeys.UserInterface.dll
Syntax
public class Button : ContentControl, ICommandSource
Constructors
Button()
Initializes a new instance of the Button class.
Declaration
public Button()
Fields
ClickEvent
The click event
Declaration
public static readonly RoutedEvent ClickEvent
Field Value
Type | Description |
---|---|
RoutedEvent |
ClickModeProperty
The click mode property
Declaration
public static readonly DependencyProperty ClickModeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CommandParameterProperty
The command parameter property
Declaration
public static readonly DependencyProperty CommandParameterProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CommandProperty
The command property
Declaration
public static readonly DependencyProperty CommandProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsPressedProperty
The is pressed property
Declaration
public static readonly DependencyProperty IsPressedProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
ClickMode
Gets or sets the click mode.
Declaration
public ClickMode ClickMode { get; set; }
Property Value
Type | Description |
---|---|
ClickMode | The click mode. |
Command
Gets or sets the command.
Declaration
public ICommand Command { get; set; }
Property Value
Type | Description |
---|---|
ICommand | The command. |
CommandParameter
Gets or sets the command parameter.
Declaration
public object CommandParameter { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The command parameter. |
IsPressed
Gets or sets a value indicating whether this instance is pressed.
Declaration
public bool IsPressed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
OnClick()
Called when button is [clicked].
Declaration
protected virtual void OnClick()
OnGamepadDown(GamepadButtonEventArgs)
Raises the GamepadDown event.
Declaration
protected override void OnGamepadDown(GamepadButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GamepadButtonEventArgs | e | The GamepadButtonEventArgs instance containing the event data. |
Overrides
OnGamepadUp(Object, GamepadButtonEventArgs)
Called when [game pad up].
Declaration
protected override void OnGamepadUp(object sender, GamepadButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender. |
GamepadButtonEventArgs | e | The GamepadButtonEventArgs instance containing the event data. |
Overrides
OnKeyDown(KeyEventArgs)
Raises the KeyDown event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | The KeyEventArgs instance containing the event data. |
Overrides
OnKeyUp(Object, KeyEventArgs)
Called when [key up].
Declaration
protected override void OnKeyUp(object sender, KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender. |
KeyEventArgs | e | The KeyEventArgs instance containing the event data. |
Overrides
OnMouseDown(MouseButtonEventArgs)
Raises the MouseDown event.
Declaration
protected override void OnMouseDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The MouseButtonEventArgs instance containing the event data. |
Overrides
OnMouseEnter(MouseEventArgs)
Raises the MouseEnter event.
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The MouseEventArgs instance containing the event data. |
Overrides
OnMouseLeave(MouseEventArgs)
Raises the MouseLeave event.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The MouseEventArgs instance containing the event data. |
Overrides
OnMouseUp(Object, MouseButtonEventArgs)
Called when [mouse up].
Declaration
protected override void OnMouseUp(object sender, MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender. |
MouseButtonEventArgs | e | The MouseButtonEventArgs instance containing the event data. |
Overrides
OnTouchDown(TouchEventArgs)
Raises the TouchDown event.
Declaration
protected override void OnTouchDown(TouchEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TouchEventArgs | e | The TouchEventArgs instance containing the event data. |
Overrides
OnTouchUp(TouchEventArgs)
Raises the TouchUp event.
Declaration
protected override void OnTouchUp(TouchEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TouchEventArgs | e | The TouchEventArgs instance containing the event data. |
Overrides
Events
Click
Occurs when [click].
Declaration
public event RoutedEventHandler Click
Event Type
Type | Description |
---|---|
RoutedEventHandler |