protected void RemoveSelection(SelectButton selection) { if (!itemGroup.Contains(selection)) { return; } selection.SelectedEvent -= OnSelectedEvent; itemGroup.Remove(selection); }
protected void AddSelection(SelectButton selection) { if (itemGroup.Contains(selection)) { return; } itemGroup.Add(selection); selection.SelectedEvent += OnSelectedEvent; }
private void OnSelectedEvent(object sender, SelectButton.SelectEventArgs args) { SelectButton selection = sender as SelectButton; if (selection != null) { if (args.IsSelected == true) { selectedIndex = selection.Index; SelectionHandler(selection); } } }
protected override void SelectionHandler(SelectButton selection) { RadioButton radio = selection as RadioButton; if (!itemGroup.Contains(radio)) { return; } foreach (RadioButton btn in itemGroup) { if (btn != null && btn != radio && btn.IsEnabled == true) { btn.IsSelected = false; } } }
public bool Contains(SelectButton selection) { return(itemGroup.Contains(selection)); }
protected virtual void SelectionHandler(SelectButton selection) { }
public int GetIndex(SelectButton selection) { return(itemGroup.IndexOf(selection)); }