相关疑难解决方法(0)

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
}
Run Code Online (Sandbox Code Playgroud)

我在XAML中绑定它:

ItemsSource ="{Binding ElementList}"

c# wpf xaml listbox list

11
推荐指数
2
解决办法
2万
查看次数

标签 统计

c# ×1

list ×1

listbox ×1

wpf ×1

xaml ×1