In This Article

BarSplitToggleButton Class

Represents a split toggle button control, for use within a ribbon or toolbar.

[PseudoClasses(new string[] { ":checked", ":unchecked" })]
public class BarSplitToggleButton : BarSplitButton, IDataContextProvider, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, IStyleable, INamed, IDataTemplateHost, ISetterValue, IChildIndexProvider, IFocusScope, IInputElement, ILogical, ICommandSource
Inheritance:
object AvaloniaObject Animatable StyledElement Visual Layoutable Interactive InputElement Control TemplatedControl ItemsControl SelectingItemsControl MenuBase BarPopupButtonBase BarPopupButton BarSplitButton object
Implements:
IDataContextProvider IThemeVariantHost IResourceHost IResourceNode IStyleHost ISetLogicalParent ISetInheritanceParent IStyleable INamed IDataTemplateHost ISetterValue IChildIndexProvider IFocusScope IInputElement ILogical ICommandSource

Constructors

BarSplitToggleButton()

Initializes a new instance of the class.

public BarSplitToggleButton()

Properties

IsChecked

Whether the control is checked.

public bool IsChecked { get; set; }

Property Value

bool:

The default value is false.

StyleKeyOverride

Gets the type by which the element is styled.

protected override Type StyleKeyOverride { get; }

Property Value

Type

Remarks

Usually controls are styled by their own type, but there are instances where you want an element to be styled by its base type, e.g. creating SpecialButton that derives from Button and adds extra functionality but is still styled as a regular Button. Override this property to change the style for a control class, returning the type that you wish the elements to be styled as.

Methods

OnClick()

Invokes the Click event.

protected override void OnClick()

OnCreateAutomationPeer()

Returns a new, type-specific Avalonia.Automation.Peers.AutomationPeer implementation for the control.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific Avalonia.Automation.Peers.AutomationPeer implementation.

OnIsCheckedChanged()

Invokes the IsCheckedChanged event.

protected virtual void OnIsCheckedChanged()

Toggle()

Toggles the button.

protected virtual void Toggle()

Events

IsCheckedChanged

Occurs when the IsChecked property is changed.

public event EventHandler<RoutedEventArgs>? IsCheckedChanged

Event Type

EventHandler<RoutedEventArgs>

Fields

IsCheckedChangedEvent

Defines the IsCheckedChanged event.

public static readonly RoutedEvent<RoutedEventArgs> IsCheckedChangedEvent

IsCheckedProperty

Defines the IsChecked property.

public static readonly StyledProperty<bool> IsCheckedProperty

Inherited Members

Extension Methods