c# - Windows Phone ListViewItem stretch to the width of ListView -


i have created 1 listview. in listview binding custom datatemplate. binding custom datatemplate listview.

<listview grid.row="1" name="myalerts" background="transparent" visibility="collapsed">     <listview.itemcontainerstyle>         <style targettype="listviewitem">             <setter property="horizontalcontentalignment" value="stretch" />         </style>     </listview.itemcontainerstyle>     <listview.itemtemplate>         <datatemplate>             <usercontrols:customdatatemplateselector content="{binding}">                 <usercontrols:customdatatemplateselector.friendrequest>                     <datatemplate>                         <border borderbrush="gray" borderthickness="0,1,0,1" background="transparent" >                             <grid>                                 //binding som element here                             </grid>                         </border>                     </datatemplate>                 </usercontrols:customdatatemplateselector.friendrequest>             </usercontrols:customdatatemplateselector>         </datatemplate>     </listview.itemtemplate> </listview> 

here issue is, items in datatemplate not horizontalically stretching. can know how stretch custom template items?

my problem solved. set horizontalcontentalignment="stretch" custom datatemplate.

<usercontrols:customdatatemplateselector content="{binding}" horizontalcontentalignment="stretch">     <usercontrols:customdatatemplateselector.friendrequest>         <datatemplate>         </datatemplate>     <usercontrols:customdatatemplateselector.friendrequest> </usercontrols:customdatatemplateselector content="{binding}" horizontalcontentalignment="stretch"> 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -