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
Post a Comment