且构网

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

WPF:设置绑定属性列表框结合

更新时间:2022-06-03 03:20:33

您不必指定模板,你可以使用的DisplayMemberPath属性,就像这样:

you don't need to specify a template, you can just use the DisplayMemberPath property, like so:

<ListBox ItemsSource="{Binding SomeCollection}" DisplayMemberPath="ThePropertyOnElm" />

希望这有助于!

hope this helps!