i using silverlight toolkit treeview show set of data. has 1000 elements , of child elements have as 500 child elements well. takes minute load data , show in treeview. tree view have virtualization? if does, 1 point me sample or code snippet please?
following xaml
<controls:treeview grid.column="0" verticalalignment="stretch" itemssource="{binding people}" > <controls:treeview.itemtemplate> <common:hierarchicaldatatemplate itemssource="{binding children}"> <stackpanel> <grid> <grid.columndefinitions> <columndefinition width="10*"/> <columndefinition width="90*"/> </grid.columndefinitions> <checkbox ischecked="{binding twostate}" grid.column="0"/> <textblock grid.column="1" text="{binding name}"/> </grid> </stackpanel> </common:hierarchicaldatatemplate> </controls:treeview.itemtemplate> </controls:treeview>
following person class use
public class person:inotifypropertychanged { public string name { get; set; } public int age { get; set; } public bool twostate { get; set; } public observablecollection<person> children { get; set; } public person() { twostate = false; children = new observablecollection<person>(); } public event propertychangedeventhandler propertychanged; private void notifypropertychanged(string info) { if (propertychanged != null) { propertychanged(this, new propertychangedeventargs(info)); } } }
you should take @ bea costa's article on matter. check out blog here. of 3.5, silverlight has opt-in virtualization tree view. 1 of things speed performance loading child nodes on demand. covers in article.
basically, boils down this: should load ui, need to.
Comments
Post a Comment