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: solution.dll
Syntax
public class Toggle : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IInputElement<bool>, IValidatableElement<bool>, INotifyValueChanged<bool>, IPressable
Constructors
Toggle()
Default constructor.
Declaration
public Toggle()
Fields
boxUssClassName
The Toggle box styling class.
Declaration
public static readonly string boxUssClassName
Field Value
Type | Description |
---|---|
string |
checkmarkContainerUssClassName
The Toggle checkmark container styling class.
Declaration
public static readonly string checkmarkContainerUssClassName
Field Value
Type | Description |
---|---|
string |
checkmarkUssClassName
The Toggle checkmark styling class.
Declaration
public static readonly string checkmarkUssClassName
Field Value
Type | Description |
---|---|
string |
labelUssClassName
The Toggle label styling class.
Declaration
public static readonly string labelUssClassName
Field Value
Type | Description |
---|---|
string |
paddedBoxUssClassName
The Toggle box padded styling class.
Declaration
public static readonly string paddedBoxUssClassName
Field Value
Type | Description |
---|---|
string |
sizeUssClassName
The Toggle size styling class.
Declaration
public static readonly string sizeUssClassName
Field Value
Type | Description |
---|---|
string |
ussClassName
The Toggle main styling class.
Declaration
public static readonly string ussClassName
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>