Table of Contents

Class ButtonSpinner

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

Represents a spinner control that includes two Buttons.

[TemplatePart("PART_DecreaseButton", typeof(Button))]
[TemplatePart("PART_IncreaseButton", typeof(Button))]
[PseudoClasses(new string[] { ":left", ":right" })]
public class ButtonSpinner : Spinner, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
ButtonSpinner
Implements
Inherited Members
Extension Methods

Constructors

ButtonSpinner()

public ButtonSpinner()

Fields

AllowSpinProperty

Defines the AllowSpin property.

public static readonly StyledProperty<bool> AllowSpinProperty

Field Value

StyledProperty<bool>

ButtonSpinnerLocationProperty

Defines the ButtonSpinnerLocation property.

public static readonly StyledProperty<Location> ButtonSpinnerLocationProperty

Field Value

StyledProperty<Location>

ShowButtonSpinnerProperty

Defines the ShowButtonSpinner property.

public static readonly StyledProperty<bool> ShowButtonSpinnerProperty

Field Value

StyledProperty<bool>

Properties

AllowSpin

Gets or sets a value indicating whether the ButtonSpinner should allow to spin.

public bool AllowSpin { get; set; }

Property Value

bool

ButtonSpinnerLocation

Gets or sets current location of the ButtonSpinner.

public Location ButtonSpinnerLocation { get; set; }

Property Value

Location

ShowButtonSpinner

Gets or sets a value indicating whether the spin buttons should be shown.

public bool ShowButtonSpinner { get; set; }

Property Value

bool

Methods

OnAllowSpinChanged(bool, bool)

Called when the AllowSpin property value changed.

protected virtual void OnAllowSpinChanged(bool oldValue, bool newValue)

Parameters

oldValue bool

The old value.

newValue bool

The new value.

OnApplyTemplate(TemplateAppliedEventArgs)

Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.

protected override void OnApplyTemplate(TemplateAppliedEventArgs e)

Parameters

e TemplateAppliedEventArgs

The event args.

OnKeyDown(KeyEventArgs)

Called before the KeyDown event occurs.

protected override void OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

The event args.

OnPointerReleased(PointerReleasedEventArgs)

Called before the PointerReleased event occurs.

protected override void OnPointerReleased(PointerReleasedEventArgs e)

Parameters

e PointerReleasedEventArgs

The event args.

OnPointerWheelChanged(PointerWheelEventArgs)

Called before the PointerWheelChanged event occurs.

protected override void OnPointerWheelChanged(PointerWheelEventArgs e)

Parameters

e PointerWheelEventArgs

The event args.

OnPropertyChanged(AvaloniaPropertyChangedEventArgs)

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.

OnValidSpinDirectionChanged(ValidSpinDirections, ValidSpinDirections)

Called when valid spin direction changed.

protected override void OnValidSpinDirectionChanged(ValidSpinDirections oldValue, ValidSpinDirections newValue)

Parameters

oldValue ValidSpinDirections

The old value.

newValue ValidSpinDirections

The new value.