Silverlight control to group other controls together for data binding -
is there control in silverlight group controls data binding. instance, have person object , want display fname, lname, age, height, etc. in textblocks. there control can use group these textblock controls , set itemsource on control similar how set itemsource on datagrid , bind each column?
group textblocks in layout control , bind control's datacontext person. if not explicitly set, each textblock's context relative parent.
<usercontrol datacontext=""> <usercontrol.datacontext> <someviewmodel /> </usercontrol.datacontext> <grid datacontext="{binding theperson}"> <textblock text="{binding fname}"/> <textblock text="{binding lname}"/> <textblock text="{binding age}"/> <textblock text="{binding height}"/> </grid> </usercontrol>
view model class...
public class someviewmodel { public person theperson { get;set; } }
Comments
Post a Comment