namespace Sandbox.UI; /// /// A group of side-by-side buttons one of which can be selected. /// [Library( "ButtonGroup" )] public class ButtonGroup : Panel { // TODO - allow multi select // TODO - allow toggle off private object _value; /// /// Called when the value has been changed. /// [Parameter] public System.Action ValueChanged { get; set; } /// /// The selected option value. /// [Parameter] public object Value { get => _value; set { if ( _value == value ) return; _value = value; ValueChanged?.Invoke( _value ); CreateEvent( "onchange" ); CreateValueEvent( "value", _value ); SetSelectedButton(); } } /// /// Options to show in this button group. /// [Parameter] public List