I got the stack trace below reported from a customer. I don\'t know how to reproduce this. My WPF application has a fair number of ComboBoxes; I\'m not sure how to determine
Here's the code (.NET 4.5.2). Either o
isn't a ComboBox
or HighlightedElement
is null.
Personally, my first step would be to distribute the PDBs so you could get line numbers in the stack trace.
private static object CoerceIsSelectionBoxHighlighted(object o, object value)
{
ComboBox comboBox = (ComboBox)o;
return (!comboBox.IsDropDownOpen && comboBox.IsKeyboardFocusWithin) ||
(comboBox.HighlightedInfo != null && comboBox.HighlightedElement.Content == comboBox._clonedElement);
}
private ComboBoxItem HighlightedElement
{
get { return (_highlightedInfo == null) ? null : _highlightedInfo.Container as ComboBoxItem; }
}