Class Toggle
Toggle UI element.
Implements
INotifyValueChanged<bool>
Inherited Members
VisualElement.ExecuteDefaultAction(EventBase)
VisualElement.Focus()
VisualElement.Overlaps(Rect)
VisualElement.ToString()
VisualElement.GetFirstOfType<T>()
VisualElement.GetFirstAncestorOfType<T>()
VisualElement.canGrabFocus
VisualElement.focusController
VisualElement.cacheAsBitmap
CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class Toggle : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<bool>, IValidatableElement<bool>, INotifyValueChanged<bool>, IPressable
Constructors
Toggle()
Default constructor.
Declaration
public Toggle()
Fields
boxUssClassName
The Toggle box styling class.
Declaration
public const string boxUssClassName = "appui-toggle__box"
Field Value
Type | Description |
---|---|
string |
checkmarkContainerUssClassName
The Toggle checkmark container styling class.
Declaration
public const string checkmarkContainerUssClassName = "appui-toggle__checkmarkcontainer"
Field Value
Type | Description |
---|---|
string |
checkmarkUssClassName
The Toggle checkmark styling class.
Declaration
public const string checkmarkUssClassName = "appui-toggle__checkmark"
Field Value
Type | Description |
---|---|
string |
labelUssClassName
The Toggle label styling class.
Declaration
public const string labelUssClassName = "appui-toggle__label"
Field Value
Type | Description |
---|---|
string |
paddedBoxUssClassName
The Toggle box padded styling class.
Declaration
public const string paddedBoxUssClassName = "appui-toggle__boxpadded"
Field Value
Type | Description |
---|---|
string |
sizeUssClassName
The Toggle size styling class.
Declaration
public const string sizeUssClassName = "appui-toggle--size-"
Field Value
Type | Description |
---|---|
string |
ussClassName
The Toggle main styling class.
Declaration
public const string ussClassName = "appui-toggle"
Field Value
Type | Description |
---|---|
string |
Properties
clickable
Clickable Manipulator for this Toggle.
Declaration
public Pressable clickable { get; set; }
Property Value
Type | Description |
---|---|
Pressable |
invalid
The invalid state of the Toggle.
Declaration
public bool invalid { get; set; }
Property Value
Type | Description |
---|---|
bool |
label
The Toggle label.
Declaration
public string label { get; set; }
Property Value
Type | Description |
---|---|
string |
validateValue
The validation function for the Toggle.
Declaration
public Func<bool, bool> validateValue { get; set; }
Property Value
Type | Description |
---|---|
Func<bool, bool> |
value
The Toggle value.
Declaration
public bool value { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
SetValueWithoutNotify(bool)
Set the Toggle value without notifying the change.
Declaration
public void SetValueWithoutNotify(bool newValue)
Parameters
Type | Name | Description |
---|---|---|
bool | newValue | The new value. |
Implements
UnityEngine.UIElements.INotifyValueChanged<T>