WPF-Filter eine ListBox

Lade ich eine Liste von strings in meinem ListBox, jetzt will ich filtern, wenn ich die Eingabe von text in ein TextBox. Wie kann ich es tun?

public void ListLoad()
{
    ElementList = new List<string>(); //creation a list of strings
    ElementList.Add("1"); //add a item of string
    ElementList.Add("2"); //add a item of string

    DataContext = this; //set the data context
}

Ich bin Bindung in XAML mit:

ItemsSource="{Binding ElementList}"

Schreibe einen Kommentar