public void AddRadioButton(RadioButtonView radioButton) { if (_buttons.Contains(radioButton)) { return; } _buttons.Add(radioButton); radioButton.RadioGroup = this; }
public void Select(RadioButtonView radioButton) { if (!_buttons.Contains(radioButton)) { return; } if (radioButton.StateOn) { return; } foreach (var radioButtonView in _buttons) { if (radioButtonView == radioButton) { continue; } radioButtonView.StateOn = false; } radioButton.StateOn = true; }
public void Notify(RadioButtonView radioButton) { if (!_buttons.Contains(radioButton)) { return; } foreach (var radioButtonView in _buttons) { if (radioButtonView == radioButton) { if (!radioButton.StateOn) { radioButton.StateOn = true; } } else { radioButtonView.StateOn = false; } } }
public void RemoveRadioButton(RadioButtonView radioButton) { _buttons.Remove(radioButton); radioButton.RadioGroup = null; }