예제 #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));
 }