c# - Not able to use Datacontext to bind data to Callisto livetiles -


this live tile template using

<callisto:livetile x:name="livetile1" grid.row="1" grid.column="0"          itemssource="{binding}"          borderbrush="white" borderthickness="1"          margin="15" background="#ffcad83e">                 <callisto:livetile.itemtemplate>                     <datatemplate>                         <grid>                             <stackpanel>                                 <textblock text="temp" fontweight="semibold"                                             fontsize="25" fontfamily="segoe ui semibold"                                             margin="10,20,0,0">                                 </textblock>                                 <stackpanel orientation="horizontal" margin="0,20,0,0">                                    <textblock text="{binding name}" x:name="crudestmaintankname"                                               fontweight="light"                                               fontsize="20"                                               fontfamily="segoe ui semilight"                                               margin="0,0,0,0">                                    </textblock>                                    <textblock text="{binding value}" x:name="crudestmaintankvalue"                                               fontweight="light"                                               fontsize="20"                                                fontfamily="segoe ui semilight"                                               margin="0,00,0,0">                                     </textblock>                                 </stackpanel>                             </stackpanel>                         </grid>                     </datatemplate>               </callisto:livetile.itemtemplate>  </callisto:livetile> 

this how assigning datacontext live tile

livetile1.datacontext = cds.componentcollection[0]; 

i have tried debug going nowhere.

now cds.componentcollection[0] retrieves item collection contaning name, type , value , collection item , binding textblock property name item property name , textblock property value item property value.
can please me on how working?

livetile itemscontrol therefore need set itemssource property collection. xaml means need set datacontext complete cds.componentcollection not first item, i.e.:

livetile1.datacontext = cds.componentcollection; 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -