System.Windows.Controls.AutoCompleteBox.TryGetMatch C# (CSharp) Méthode

TryGetMatch() private méthode

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.
Résultat 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;
        }