c# - WPF ListView binding mutliple sources -
i have listview , display multiple collections of same type (contrary other topics found multiple binding), or better - unediable item, "default item", first item in listview , multiple concatenated collections of same type. example 1 collection , 1 item:
<listview itemssource="{binding people}"> <listview.itemtemplate> <datatemplate> <wrappanel> <textblock text="{binding name}" /> </wrappanel> </datatemplate> </listview.itemtemplate> <listviewitem itemssource="{binding patientzero}"> <wrappanel> <textblock text="{binding name}" /> </wrappanel> </listviewitem> </listview>
and
public class person { public string name { get; set; } public person(){} }
...and code
observablecollection<person> _people = new observablecollection<person>(); public observablecollection<person> people { { return _people; } } person patientzero { { return _patientzero ; } } person _patientzero = new person { name="unknown"}
obviously, wont work wont past xaml parser (not mentioning syntax, example). ofcourse regulary concat collections , check if edited item isnt first one, curious if can solved.
ideas achieve that?
not sure if need. problem description can clearer.
observablecollection<observablecollection<person>> peoplelists{get;set;}
bind in xaml
<listview itemssource="{binding peoplelists}"> <listview.itemtemplate> <datatemplate> <listview itemssource={binding}> <listview.itemtemplate> <datatemplate> <wrappanel> <textblock text="{binding name}" /> </wrappanel> </datatemplate> </listview.itemtemplate> </listview> </datatemplate> </listview.itemtemplate> </listview>
Comments
Post a Comment