Exemplo n.º 1
0
 public void AddRadioButton(RadioButtonView radioButton)
 {
     if (_buttons.Contains(radioButton))
     {
         return;
     }
     _buttons.Add(radioButton);
     radioButton.RadioGroup = this;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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;
         }
     }
 }
Exemplo n.º 4
0
 public void RemoveRadioButton(RadioButtonView radioButton)
 {
     _buttons.Remove(radioButton);
     radioButton.RadioGroup = null;
 }