public event SelectionChangedEventHandler CxOnSelectionChange; //addEvent
 private void CombBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (CxOnSelectionChange != null)
     {
         CxOnSelectionChange.Invoke(this, e);
     }
     if (!IsAutoComplete)
     {
         NewItem = CombBox.Items[CombBox.SelectedIndex];
     }
 }
Esempio n. 2
0
        private void ListObjects_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var list = sender as ListBox;

            for (int i = 0; i < list.Items.Count; i++)
            {
                var item = ((ObjectListItem)list.Items[i]);
                if (i == list.SelectedIndex)
                {
                    item.IsSelected = true;
                }
                else
                {
                    item.IsSelected = false;
                }
            }

            if (CxOnSelectionChange != null)
            {
                CxOnSelectionChange.Invoke(this, e);
            }
        }