i dynamically want add panorama items in application. no. of item(3 7) depend on json response getting. presently testing created 4 items in xaml , works me not dynamic. here xaml.
<grid x:name="layoutroot"> <controls:panorama title="my panorama" loaded="panorama_loaded" name="title1" itemssource="{binding}"> <controls:panorama.background> <imagebrush imagesource="/images/panaroma_bg.png"/> </controls:panorama.background> <!--panorama item one--> <controls:panoramaitem header="item1" name="dashboard1" headertemplate="{staticresource dashboardname}"> <grid> <listbox height="512" horizontalalignment="left" margin="6,8,0,0" name="listbox1" verticalalignment="top" width="403" tap="listbox1_tap"> <listbox.itemtemplate> <datatemplate> <grid> <rectangle height="100" width="400" horizontalalignment="left" name="rectangle1" stroke="black" strokethickness="1" verticalalignment="top"/> <stackpanel orientation="horizontal"> <image width="100" height="100" source="{binding image}" stretch="fill" horizontalalignment="left" verticalalignment="top" /> <stackpanel orientation="horizontal" height="132"> <stackpanel width="300" horizontalalignment="left"> <grid> <textblock text="{binding currentvalue}" horizontalalignment="left" fontsize="25" /> <image width="20" height="20" source="{binding subimage}" stretch="fill" horizontalalignment="right" verticalalignment="bottom"/> <textblock text="{binding previousvalue}" horizontalalignment="right" verticalalignment="top" fontsize="15" /> </grid> <stackpanel width="290" horizontalalignment="right" verticalalignment="stretch" orientation="vertical"> <textblock text="{binding itemname}" fontsize="20" textwrapping="wrap" width="290" horizontalalignment="left" verticalalignment="bottom"/> </stackpanel> </stackpanel> </stackpanel> </stackpanel> </grid> </datatemplate> </listbox.itemtemplate> </listbox> </grid> </controls:panoramaitem> <!--panorama item two--> <!--panorama item three--> <!--.................--> </controls:panorama> </grid>
i don't want write xaml panorama item two, panorama item 3 , on think there must way @ runtime. please me out.
there must template thing can use. , fill inner items currentvalue
, itemname
etc. through code
i have tested below code pivot. can implement similar panaroma
dim objpivotitem pivotitem dim sscrollviewer scrollviewer dim sstackpanel stackpanel dim textheader textblock dim txtcontents richtextbox = 0 <condition> objpivotitem = new pivotitem sstackpanel = new stackpanel sscrollviewer = new scrollviewer textheader = new textblock txtcontents = new richtextbox 'set textheader properties 'set txtcontents properties objpivotitem.content = sscrollviewer sscrollviewer.content = sstackpanel sstackpanel.children.add(textheader) sstackpanel.children.add(txtcontents) objpivot.items.add(objpivotitem ) next
Comments
Post a Comment