Skip to main content

Buttons Class

Namespace: GHIElectronics.TinyCLR.UI.Input · Assembly: GHIElectronics.TinyCLR.UI

The Button class represents the button device to the members of a context.

public sealed class Buttons

Properties

FocusedElement

public static UIElement FocusedElement { get; }

Returns the element that the button is focused on.

PrimaryDevice

public static ButtonDevice PrimaryDevice { get; }

The primary button device.

Methods

RoutedEvent( , RoutingStrategy.Tunnel, typeof(ButtonEventHandler))

public static readonly RoutedEvent PreviewButtonDownEvent = new RoutedEvent( , RoutingStrategy.Tunnel, typeof(ButtonEventHandler))

PreviewButtonDown

ParameterTypeDescription
````
RoutingStrategy.Tunnel``
typeof(ButtonEventHandler)``

Returns RoutedEvent PreviewButtonDownEvent = new

RoutedEvent( , RoutingStrategy.Tunnel, typeof(ButtonEventHandler))

public static readonly RoutedEvent PreviewButtonUpEvent = new RoutedEvent( , RoutingStrategy.Tunnel, typeof(ButtonEventHandler))

PreviewButtonUp

ParameterTypeDescription
````
RoutingStrategy.Tunnel``
typeof(ButtonEventHandler)``

Returns RoutedEvent PreviewButtonUpEvent = new

RoutedEvent( , RoutingStrategy.Bubble, typeof(ButtonEventHandler))

public static readonly RoutedEvent ButtonDownEvent = new RoutedEvent( , RoutingStrategy.Bubble, typeof(ButtonEventHandler))

ButtonDown

ParameterTypeDescription
````
RoutingStrategy.Bubble``
typeof(ButtonEventHandler)``

Returns RoutedEvent ButtonDownEvent = new

RoutedEvent( , RoutingStrategy.Bubble, typeof(ButtonEventHandler))

public static readonly RoutedEvent ButtonUpEvent = new RoutedEvent( , RoutingStrategy.Bubble, typeof(ButtonEventHandler))

ButtonUp

ParameterTypeDescription
````
RoutingStrategy.Bubble``
typeof(ButtonEventHandler)``

Returns RoutedEvent ButtonUpEvent = new

RoutedEvent( , RoutingStrategy.Bubble, typeof(FocusChangedEventHandler))

public static readonly RoutedEvent GotFocusEvent = new RoutedEvent( , RoutingStrategy.Bubble, typeof(FocusChangedEventHandler))

GotFocus

ParameterTypeDescription
````
RoutingStrategy.Bubble``
typeof(FocusChangedEventHandler)``

Returns RoutedEvent GotFocusEvent = new

RoutedEvent( , RoutingStrategy.Bubble, typeof(FocusChangedEventHandler))

public static readonly RoutedEvent LostFocusEvent = new RoutedEvent( , RoutingStrategy.Bubble, typeof(FocusChangedEventHandler))

LostFocus

ParameterTypeDescription
````
RoutingStrategy.Bubble``
typeof(FocusChangedEventHandler)``

Returns RoutedEvent LostFocusEvent = new

Focus(UIElement element)

public static UIElement Focus(UIElement element)

Focuses the button on a particular element.

ParameterTypeDescription
elementUIElementThe element to focus the button on.

Returns UIElement

IsButtonDown(HardwareButton button)

public static bool IsButtonDown(HardwareButton button)

Returns whether or not the specified button is down.

ParameterTypeDescription
buttonHardwareButton

Returns bool

IsButtonUp(HardwareButton button)

public static bool IsButtonUp(HardwareButton button)

Returns whether or not the specified button is up.

ParameterTypeDescription
buttonHardwareButton

Returns bool

IsButtonHeld(HardwareButton button)

public static bool IsButtonHeld(HardwareButton button)

Returns whether or not the specified button is held.

ParameterTypeDescription
buttonHardwareButton

Returns bool

GetButtonState(HardwareButton button)

public static ButtonState GetButtonState(HardwareButton button)

Returns the state of the specified button.

ParameterTypeDescription
buttonHardwareButton

Returns ButtonState