Пример #1
0
        protected override DependencyObject GetContainerForItemOverride()
        {
            var comboBoxItem = new ComboBoxItemEx();

            RegisterEventHandlerForWhenIsHighlightedChanges(comboBoxItem);
            return(comboBoxItem);
        }
Пример #2
0
 private void RemoveHighlightFromCurrentlyHighlightedItem()
 {
     if (HighlightedItem != null)
     {
         ComboBoxItemEx highlightedComboBoxItem = GetHighlightedComboBoxItem();
         highlightedComboBoxItem.IsHighlighted = false;
     }
 }
Пример #3
0
 private void GetComboBoxNullItemFromTemplate()
 {
     _comboBoxNullItem = GetTemplateChild("PART_NullValue") as ComboBoxItemEx;
 }
Пример #4
0
 private void OnComboBoxItemHighlighted(ComboBoxItemEx comboBoxItem)
 {
     HighlightedItem = comboBoxItem.DataContext;
     RemoveHighlightFromComboBoxNullItem();
 }
Пример #5
0
 private void RegisterEventHandlerForWhenIsHighlightedChanges(ComboBoxItemEx comboBoxItem)
 {
     DependencyPropertyDescriptor.FromProperty(ComboBoxItem.IsHighlightedProperty, typeof(ComboBoxItemEx)).
     AddValueChanged(comboBoxItem, (o, e) => OnComboBoxItemHighlighted(o as ComboBoxItemEx));
 }