OnLostFocus Not Firing in Autocompletebox.

Jul 26, 2010 at 11:38 AM

The OnLostFocus Event is not fired for the AutoCompleteBox.

I want to select the item, if it is only one shown in the dropdown,  or clear the text, if no item is selected, on the lost focus of the autocompletebox.


        protected override void OnLostFocus(RoutedEventArgs e)
            if (SelectedItem == null)
                if (IsDropDownOpen && SourceHasExactlyOneItem)
                    Text = string.Empty;

But, the OnLostFocus is not triggering.