private void SelectChange(UIElement source, EventArgs <bool> e) { if (e.Value) { UIRadioButton radio = (UIRadioButton)source; selected.Add(radio); OnSelected?.Invoke(this, new UIRadioButtonEventArgs(radio)); if (!Multiselect) { for (int i = 0; i < selected.Count; i++) { if (selected[i] != radio) { selected[i].Selected = false; } } } } else { UIRadioButton radio = (UIRadioButton)source; selected.Remove(radio); OnDeselected?.Invoke(this, new UIRadioButtonEventArgs(radio)); if (AlwaysSelected && selected.Count < 1) { radio.Selected = true; e.Value = true; } } }
public UIRadioButtonEventArgs(UIRadioButton target) { Target = target; }