WPF Фильтр ListBox
Я загружаю список строк в моемListBox
Теперь я хочу отфильтровать его при вводе текста вTextBox
, Как я могу это сделать?
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
}
Я связываю это в XAML с:
ItemsSource = "{Binding ElementList}"