Class Button
Button UI element.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class Button : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, ISizeableElement, IPressable
Constructors
Button()
Default constructor.
Declaration
public Button()
Button(Action)
Constructs a button with an Action that is triggered when the button is clicked.
Declaration
public Button(Action clickEvent)
Parameters
Type | Name | Description |
---|---|---|
Action | clickEvent | The action triggered when the button is clicked. |
Remarks
By default, a single left mouse click triggers the Action. To change the activator, modify clickable.
Fields
iconOnlyUssClassName
The Button icon only variant styling class.
Declaration
public static readonly string iconOnlyUssClassName
Field Value
Type | Description |
---|---|
string |
leadingContainerUssClassName
The Button leading container styling class.
Declaration
public static readonly string leadingContainerUssClassName
Field Value
Type | Description |
---|---|
string |
leadingIconUssClassName
The Button leading icon styling class.
Declaration
public static readonly string leadingIconUssClassName
Field Value
Type | Description |
---|---|
string |
quietUssClassName
The Button quiet mode styling class.
Declaration
public static readonly string quietUssClassName
Field Value
Type | Description |
---|---|
string |
sizeUssClassName
The Button size styling class.
Declaration
public static readonly string sizeUssClassName
Field Value
Type | Description |
---|---|
string |
subtitleUssClassName
The Button subtitle styling class.
Declaration
public static readonly string subtitleUssClassName
Field Value
Type | Description |
---|---|
string |
titleContainerUssClassName
The Button title container styling class.
Declaration
public static readonly string titleContainerUssClassName
Field Value
Type | Description |
---|---|
string |
titleUssClassName
The Button title styling class.
Declaration
public static readonly string titleUssClassName
Field Value
Type | Description |
---|---|
string |
trailingContainerUssClassName
The Button trailing container styling class.
Declaration
public static readonly string trailingContainerUssClassName
Field Value
Type | Description |
---|---|
string |
trailingIconUssClassName
The Button trailing icon styling class.
Declaration
public static readonly string trailingIconUssClassName
Field Value
Type | Description |
---|---|
string |
ussClassName
The Button main styling class.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
string |
variantUssClassName
The Button variant styling class.
Declaration
public static readonly string variantUssClassName
Field Value
Type | Description |
---|---|
string |
Properties
clickable
Clickable Manipulator for this Button.
Declaration
public Pressable clickable { get; }
Property Value
Type | Description |
---|---|
Pressable |
contentContainer
The content container of this element.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
leadingIcon
The Button leading icon.
Declaration
public string leadingIcon { get; set; }
Property Value
Type | Description |
---|---|
string |
quiet
The quiet state of the Button.
Declaration
public bool quiet { get; set; }
Property Value
Type | Description |
---|---|
bool |
size
The Button size.
Declaration
public Size size { get; set; }
Property Value
Type | Description |
---|---|
Size |
subtitle
The subtitle of the Button.
Declaration
public string subtitle { get; set; }
Property Value
Type | Description |
---|---|
string |
title
The title of the Button.
Declaration
public string title { get; set; }
Property Value
Type | Description |
---|---|
string |
trailingIcon
The Button trailing icon.
Declaration
public string trailingIcon { get; set; }
Property Value
Type | Description |
---|---|
string |
variant
The button variant.
Declaration
public ButtonVariant variant { get; set; }
Property Value
Type | Description |
---|---|
ButtonVariant |
Events
clicked
Event triggered when the Button has been clicked.
Declaration
public event Action clicked
Event Type
Type | Description |
---|---|
Action |