Button class¶
Defined in
Namespace: CrissCross.Avalonia.UI.Controls
Assembly: CrissCross.Avalonia.UI.dll
Full name: CrissCross.Avalonia.UI.Controls.Button
Modifiers: public
Summary¶
Represents a button control that can display an icon and supports customizable appearance, including visual states
for mouse over and pressed interactions.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net471
Class hierarchy
classDiagram
class Button
class Button
Button <|-- Button
class IAppearanceControl {
<>
}
IAppearanceControl <|.. Button
class IIconControl {
<>
}
IIconControl <|.. Button
Inherits from: Button
Implements: IAppearanceControl, IIconControl
Remarks¶
The Button control extends the standard Avalonia button by providing additional properties for appearance customization, such as icon support, corner radius, and brushes for different visual states. It implements IAppearanceControl and IIconControl, allowing integration with appearance and icon-related features in Avalonia applications.
Constructors¶
| Name | Summary |
|---|---|
| .ctor |
Properties¶
| Name | Summary |
|---|---|
| Icon | Gets or sets displayed [IconElement](# |
| Appearance | Gets or sets the [Appearance](# of the control, if available. |
| MouseOverBackground | Gets or sets background brush when the user interacts with an element with a pointing device. |
| MouseOverBorderBrush | Gets or sets border brush when the user interacts with an element with a pointing device. |
| MouseOverForeground | Gets or sets foreground brush when the user interacts with an element with a pointing device. |
| PressedForeground | Gets or sets foreground when pressed. |
| PressedBackground | Gets or sets background brush when the user clicks the button. |
| PressedBorderBrush | Gets or sets border brush when the user clicks the button. |
| CornerRadius | Gets or sets a value that represents the degree to which the corners are rounded. |
Fields¶
| Name | Summary |
|---|---|
| static IconProperty | Property for [Icon](# |
| static AppearanceProperty | Property for [Appearance](# |
| static MouseOverBackgroundProperty | Property for [MouseOverBackground](# |
| static MouseOverBorderBrushProperty | Property for [MouseOverBorderBrush](# |
| static MouseOverForegroundProperty | Property for [MouseOverForeground](# |
| static PressedForegroundProperty | Property for [PressedForeground](# |
| static PressedBackgroundProperty | Property for [PressedBackground](# |
| static PressedBorderBrushProperty | Property for [PressedBorderBrush](# |
| static CornerRadiusProperty | Property for [CornerRadius](# |