예제 #1
0
 protected void RemoveSelection(SelectButton selection)
 {
     if (!itemGroup.Contains(selection))
     {
         return;
     }
     selection.SelectedEvent -= OnSelectedEvent;
     itemGroup.Remove(selection);
 }
예제 #2
0
 protected void AddSelection(SelectButton selection)
 {
     if (itemGroup.Contains(selection))
     {
         return;
     }
     itemGroup.Add(selection);
     selection.SelectedEvent += OnSelectedEvent;
 }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
        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;
                }
            }
        }
예제 #5
0
 public bool Contains(SelectButton selection)
 {
     return(itemGroup.Contains(selection));
 }
예제 #6
0
 protected virtual void SelectionHandler(SelectButton selection)
 {
 }
예제 #7
0
 public int GetIndex(SelectButton selection)
 {
     return(itemGroup.IndexOf(selection));
 }