private void OnSelectedChanged(object sender, SelectedChangedEventArgs args) { SelectButton selection = sender as SelectButton; if (selection != null) { if (args.IsSelected == true) { selectedIndex = selection.Index; if (EnableMultiSelection == false) { foreach (SelectButton btn in ItemGroup) { if ((btn != null) && (btn != selection) && (btn.IsEnabled == true) && (btn.IsSelected == true)) { btn.IsSelected = false; } } } SelectionHandler(selection); } } }
protected void RemoveSelection(SelectButton selection) { if (!ItemGroup.Contains(selection)) { return; } selection.SelectedChanged -= OnSelectedChanged; ItemGroup.Remove(selection); }
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; }
protected internal void RemoveSelection(SelectButton selection) { if (!ItemGroup.Contains(selection)) { return; } selection.SelectedChanged -= GroupSelectionHandler; ItemGroup.Remove(selection); selection.ResetItemGroup(); }
protected void AddSelection(SelectButton selection) { if (null == selection) { return; } if (ItemGroup.Contains(selection)) { return; } ItemGroup.Add(selection); selection.SelectedChanged += OnSelectedChanged; }
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 internal void AddSelection(SelectButton selection) { if (null == selection) { return; } if (ItemGroup.Contains(selection)) { return; } selection.RemoveFromGroup(); ItemGroup.Add(selection); selection.SelectedChanged += GroupSelectionHandler; }
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; } } }
protected override void SelectionHandler(SelectButton selection) { TabButton selectedTab = selection as TabButton; if (selectedTab == null) { throw new ArgumentNullException(nameof(selection), "selection should not be null."); } if (ItemGroup.Contains(selectedTab) == false) { throw new ArgumentException("selection does not exist in TabButtonGroup.", nameof(selection)); } foreach (TabButton tabButton in ItemGroup) { if ((tabButton != null) && (tabButton != selectedTab) && (selectedTab.IsEnabled == true)) { tabButton.IsSelected = false; tabButton.SetTabButtonState(ControlState.Normal); } } }
protected virtual void SelectionHandler(SelectButton selection) { }
public int GetIndex(SelectButton selection) { return(ItemGroup.IndexOf(selection)); }
public bool Contains(SelectButton selection) { return(ItemGroup.Contains(selection)); }
protected virtual void OnSelectedChanged(SelectButton selection) { SelectedChanged?.Invoke(this, new EventArgs()); }