.net - How to apply a data template to a ListBox? -


i have listbox, when event occur outside listbox (ex click on button) need apply

categoriesunselecteddatatemplate 

to element of categorieslistbox

anyidea how solve this?

        <custom:surfacelistbox                 x:name="categorieslistbox"                 scrollviewer.horizontalscrollbarvisibility="disabled"                 scrollviewer.verticalscrollbarvisibility="hidden"                 manipulationdelta="categorieslistbox_manipulationdelta"                 ismanipulationenabled="true"                 selectionchanged="categorieslistbox_selectionchanged"                 itemtemplate="{dynamicresource categoriesunselecteddatatemplate}"                 verticalcontentalignment="stretch"                 horizontalcontentalignment="stretch"                 selectionmode="single"                 margin="115,131,-117,-49">         </custom:surfacelistbox>        <datatemplate x:key="categoriesunselecteddatatemplate">         <grid>             <grid.columndefinitions>                 <columndefinition width="auto"/>                 <columndefinition width="*"/>             </grid.columndefinitions>             <textblock name="titlecategory" textwrapping="wrap"                            text="{binding capitalizeddescription, fallbackvalue=categoryname}"                            foreground="#2fb8dc"                            fontfamily="/gateeclientwpf;component/fonts/#letter gothic l"                            horizontalalignment="left"                            verticalalignment="center"                            fontsize="30"                            margin="0,10"/>             <image source="assets/common/right_grey.png" width="20" height="20" visibility="visible" horizontalalignment="left" verticalalignment="center" d:layoutoverrides="height" grid.column="1" margin="10,0,0,0"/>         </grid>     </datatemplate> 


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -