Class RadioGroup
A container for a set of Radio UI elements.
Implements
INotifyValueChanged<int>
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 RadioGroup : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IInputElement<int>, IValidatableElement<int>, INotifyValueChanged<int>
Constructors
RadioGroup()
Default constructor.
Declaration
public RadioGroup()
RadioGroup(IList, Action<Radio, int>)
Construct a RadioGroup UI element using a provided collection of items.
Declaration
public RadioGroup(IList items, Action<Radio, int> bindItem = null)
Parameters
Type | Name | Description |
---|---|---|
IList | items | A collection of items that will be displayed as Radio component. |
Action<Radio, int> | bindItem | A function invoked to bind display data per item. |
Fields
ussClassName
The RadioGroup main styling class.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
string |
Properties
bindItem
The function invoked to bind display data per item.
Declaration
public Action<Radio, int> bindItem { get; set; }
Property Value
Type | Description |
---|---|
Action<Radio, int> |
contentContainer
The RadioGroup content container.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
invalid
The RadioGroup invalid state.
Declaration
public bool invalid { get; set; }
Property Value
Type | Description |
---|---|
bool |
sourceItems
The collection of items that will be displayed as Radio component.
Declaration
public IList sourceItems { get; set; }
Property Value
Type | Description |
---|---|
IList |
validateValue
The RadioGroup validation function.
Declaration
public Func<int, bool> validateValue { get; set; }
Property Value
Type | Description |
---|---|
Func<int, bool> |
value
The selected item index.
Declaration
public int value { get; set; }
Property Value
Type | Description |
---|---|
int |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | if the value is out of range. |
Methods
SetValueWithoutNotify(int)
Set the value without notifying the listeners.
Declaration
public void SetValueWithoutNotify(int newValue)
Parameters
Type | Name | Description |
---|---|---|
int | newValue | The new value. |
Implements
UnityEngine.UIElements.INotifyValueChanged<T>