System.Windows.Controls.AutoCompleteBox.TryGetMatch C# (CSharp) Method

TryGetMatch() private method

Attempts to look through the view and locate the specific exact text match.
private TryGetMatch ( string searchText, ObservableCollection view, AutoCompleteFilterPredicate predicate ) : object
searchText string The search text.
view ObservableCollection The view reference.
predicate AutoCompleteFilterPredicate The predicate to use for the partial or /// exact match.
return object
        private object TryGetMatch(string searchText, ObservableCollection<object> view, AutoCompleteFilterPredicate<string> predicate)
        {
            if(view != null && view.Count > 0)
            {
                return view.FirstOrDefault(o => predicate(searchText, FormatValue(o)));
            }

            return null;
        }