c# - Extracting data templates in user controls -


there known problems setting caliburn binding in datatemplates.

in this answer eisenbergeffect suggests extracting data templates user control.

how can achieved?

in user control have lots of datatemplates , ran problems. conventions not applied , have use "classical" binding.

i imagine extract whole control datatemplate, give me lots of smaller controls, see no way extract datatemplate.

here example xaml

<grid>     <grid.resources />     <grid.rowdefinitions>         <rowdefinition height="10*" />         <rowdefinition height="2*" />         <rowdefinition height="1*" />     </grid.rowdefinitions>     <grid.columndefinitions>         <columndefinition width="1*" />     </grid.columndefinitions>      <border horizontalalignment="stretch"             borderbrush="transparent"             borderthickness="0">         <scrollviewer horizontalcontentalignment="stretch"                       background="yellow"                       borderbrush="transparent"                       borderthickness="0"                       cancontentscroll="true"                       horizontalscrollbarvisibility="auto"                       verticalscrollbarvisibility="auto">               <!-- conventions work here -->             <listview x:name="computers"                        horizontalcontentalignment="stretch"                       background="red"                       borderthickness="0">                 <listview.itemtemplate>                     <datatemplate>                         <border background="transparent"                                 borderbrush="transparent"                                 borderthickness="0">                             <listview horizontalcontentalignment="stretch"                                       background="black"                                       itemssource="{binding hardwarecomponents}">  <!-- conventions not work here -->                                 <listview.itemtemplate>                                     <datatemplate>                                         <border background="aquamarine"                                                 borderbrush="darkgray"                                                 borderthickness="1">                                             <grid background="transparent" cal:message.attach="[event mousedown] = [action expand($datacontext)]" >                                                 <grid.rowdefinitions>                                                     <rowdefinition height="20" />                                                 </grid.rowdefinitions>                                                 <border borderbrush="red" horizontalalignment="stretch" verticalalignment="stretch">                         <!-- more datatemplates come here -->                                                 </border>                                             </grid>                                         </border>                                     </datatemplate>                                 </listview.itemtemplate>                             </listview>                         </border>                     </datatemplate>                 </listview.itemtemplate>             </listview>         </scrollviewer>     </border> </grid> 


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -