xaml - ListView alignment issue in Windows 8 -


i have strange issue, tried every trick knew centre align listview placed inside grid. no matter what, looks left aligned. width , height of listview data bound. (width can take values 350 or 700 , height can take 100 or 200 depending on size settings. if size settings compact should 350x100 , and if normal 700x200).

this xaml code

<grid x:name="gridpagelvportrait" grid.row="1" grid.column="0" grid.columnspan="4" background="beige" horizontalalignment="center" verticalalignment="top" margin="0,0,584.714,0" width="781">    <listview x:name="pagelvportrait" itemssource="{binding}" canreorderitems="true" allowdrop="true" horizontalalignment="center" selectionmode="single" isswipeenabled="true" isitemclickenabled="true" selectionchanged="pagelvportraitselectionchanged" itemclick="pagelvportraititemclick" height="{binding templateheight}" width="{binding templatewidth}" >         <listview.itemtemplate>              <datatemplate>                  <canvas horizontalalignment="center" width="{binding templatewidth}" height="{binding templateheight}">                      <canvas.background>                           <imagebrush imagesource="{binding pagebackground}"/>                      </canvas.background>                      <image horizontalalignment="center" height="{binding templateheight}" width="{binding templatewidth}" source="{binding page}" stretch="none" opacity="1" cachemode="bitmapcache" />                       <stackpanel x:name="editdeletestackpanel" width="{binding templatewidth}" height="{binding templateheight}" opacity="0.95">                          <button x:name="notedelete"  horizontalalignment="right"   verticalalignment="top" foreground="{x:null}" tapped="notedelete_tapped" minwidth="50" minheight="50" margin="0,0,10,0" borderbrush="{x:null}" >                             <button.background>                                 <imagebrush imagesource="{binding delete}"/>                             </button.background>                          </button>                          <button x:name="noteedit"  horizontalalignment="right"   verticalalignment="top"   fontfamily="segoe script" fontsize="24" borderbrush="{x:null}" tapped="noteedit_tapped" foreground="{x:null}" minwidth="50" minheight="50" margin="0,0,10,0">                             <button.background>                                 <imagebrush imagesource="{binding edit}"/>                             </button.background>                          </button>                                                   </stackpanel>                  </canvas>              </datatemplate>         </listview.itemtemplate>    </listview> </grid> 

could kindly help?

i've tried code, in whole page grid normal dimension convention provided (700x200). listview center aligned if ignore grid's margin="0,0,584.714,0". if need 584px in right of page, i'd better put grid's column there width.


Comments

Popular posts from this blog

asp.net mvc 3 - Using mvc3, I need to add a username/password to the sql connection string at runtime -

kineticjs - draw multiple lines and delete individual line -

thumbnails - jQuery image rotate on hover -