Table of Contents

Class ButtonBase

Namespace
Myra.Graphics2D.UI
Assembly
Myra.dll

An abstract base class for button-like content controls that can be pressed and respond to click events.

public abstract class ButtonBase : ContentControl, IItemWithId, INotifyAttachedPropertyChanged, IContent
Inheritance
ButtonBase
Implements
Derived
Inherited Members

Properties

ReadOnly

Gets or sets whether the button ignores input. When true, the button cannot be pressed, clicked, or toggled, though it remains fully rendered.

public bool ReadOnly { get; set; }

Property Value

bool

Methods

ApplyButtonStyle(ButtonStyle)

Applies the specified button style to this button.

public void ApplyButtonStyle(ButtonStyle style)

Parameters

style ButtonStyle

The button style to apply.

ApplyImageButtonStyle(ImageButtonStyle)

Applies the specified image button style to the button.

public void ApplyImageButtonStyle(ImageButtonStyle style)

Parameters

style ImageButtonStyle

The image button style to apply.

CopyFrom(Widget)

Copies the button properties from another button.

protected override void CopyFrom(Widget w)

Parameters

w Widget

The source button to copy from.

DoClick()

Simulates a click on the button by firing touch down and touch up events.

public void DoClick()

InternalOnTouchDown()

Called when a touch point is pressed on the button. Derived classes should override to implement custom touch down behavior.

protected abstract void InternalOnTouchDown()

InternalOnTouchUp()

Called when a touch point is released on the button. Derived classes should override to implement custom touch up behavior.

protected abstract void InternalOnTouchUp()

OnTouchDown()

Handles touch down events on the button.

public override void OnTouchDown()

OnTouchUp()

Handles touch up events on the button.

public override void OnTouchUp()

Events

Click

Occurs when the button is clicked.

public event MyraEventHandler Click

Event Type

MyraEventHandler