且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WPF数据绑定-将List绑定到ListView

更新时间:2022-05-08 02:00:30

您只是没有填充列表视图
示例操作方法:

someName.ItemsSource = Data.PNumber();

您可以放入someName.ItemSource =//这样的特殊方法,如GetYourPNumbers()

在您的listview定义中添加someName
ItemContainerStyle ="{StaticResource ItemContStyle}";
ItemsSource ="{Binding}";
You just didn''t populate your listview
Example how to do it:

someName.ItemsSource = Data.PNumber();

You can put into the someName.ItemSource=// a special method like GetYourPNumbers()

Add to your definition of the listview someName
ItemContainerStyle="{StaticResource ItemContStyle}";
ItemsSource="{Binding}";