Sunday, 15 September 2013

xaml - How can I add a botton on the right side of the Pivot Header -



xaml - How can I add a botton on the right side of the Pivot Header -

i working on app on windows phone 8.1. have pivot command in app. want add together button on right side of pivot header. basically, want button overlay pivot header of pivot control.

so go , edit template pivot control, add together '' under pivotheaderpanel nil shows up. tried move within "pivotheaderpanel ", xaml compiler gives me warning.

is there way accomplish want?

class="lang-xaml prettyprint-override"> <scrollviewer x:name="scrollviewer" horizontalsnappointsalignment="center" horizontalsnappointstype="mandatorysingle" horizontalscrollbarvisibility="hidden" margin="{templatebinding padding}" grid.row="1" template="{staticresource scrollviewerscrollbarlesstemplate}" verticalsnappointstype="none" verticalscrollbarvisibility="disabled" verticalscrollmode="disabled" verticalcontentalignment="stretch" zoommode="disabled"> <pivotpanel x:name="panel" verticalalignment="stretch"> <pivotheaderpanel x:name="header"> <pivotheaderpanel.rendertransform> <compositetransform x:name="headertranslatetransform" translatex="0"/> </pivotheaderpanel.rendertransform> </pivotheaderpanel> <button content="mybotton" horizontalalignment="right"/> <itemspresenter x:name="pivotitempresenter"> <itemspresenter.rendertransform> <translatetransform x:name="itemspresentertranslatetransform" x="0"/> </itemspresenter.rendertransform> </itemspresenter> </pivotpanel> </scrollviewer>

i tried editing template control, looks doesn't have one. best alternative insert button did. difference is, overlay button on header using top container grid. so:

<scrollviewer x:name="scrollviewer" horizontalsnappointsalignment="center" horizontalsnappointstype="mandatorysingle" horizontalscrollbarvisibility="hidden" margin="{templatebinding padding}" grid.row="1" template="{staticresource scrollviewerscrollbarlesstemplate}" verticalsnappointstype="none" verticalscrollbarvisibility="disabled" verticalscrollmode="disabled" verticalcontentalignment="stretch" zoommode="disabled"> <pivotpanel x:name="panel" verticalalignment="stretch"> <pivotheaderpanel x:name="header"> <pivotheaderpanel.rendertransform> <compositetransform x:name="headertranslatetransform" translatex="0"/> </pivotheaderpanel.rendertransform> </pivotheaderpanel> <itemspresenter x:name="pivotitempresenter"> <itemspresenter.rendertransform> <translatetransform x:name="itemspresentertranslatetransform" x="0"/> </itemspresenter.rendertransform> </itemspresenter> </pivotpanel> </scrollviewer> <button x:name="mybutton" content="my button" grid.row="1" verticalalignment="top" horizontalalignment="right"></button>

preview of style

xaml windows-phone-8.1

No comments:

Post a Comment