c# - UWP Create a content dialog with one big button -


i'm trying create content dialog 1 button in center

i've trying change style content dialog using style code nothing changed ii still have 2 button , if use 1 button keeps on left

here's code

    <!-- default style windows.ui.xaml.controls.contentdialog --> <style targettype="contentdialog">     <setter property="foreground" value="{themeresource systemcontrolpagetextbasehighbrush}" />     <setter property="background" value="{themeresource systemcontrolbackgroundchromemediumlowbrush}" />     <setter property="horizontalalignment" value="center" />     <setter property="verticalalignment" value="top" />     <setter property="istabstop" value="false" />     <setter property="maxheight" value="{themeresource contentdialogmaxheight}" />     <setter property="minheight" value="{themeresource contentdialogminheight}" />     <setter property="maxwidth" value="{themeresource contentdialogmaxwidth}" />     <setter property="minwidth" value="{themeresource contentdialogminwidth}" />     <setter property="template">         <setter.value>             <controltemplate targettype="contentdialog">                 <border x:name="container">                     <grid x:name="layoutroot">                         <grid.rowdefinitions>                             <rowdefinition height="auto" />                         </grid.rowdefinitions>                         <grid.columndefinitions>                             <columndefinition width="auto" />                         </grid.columndefinitions>                         <border x:name="backgroundelement"                 background="{templatebinding background}"                 flowdirection="{templatebinding flowdirection}"                 borderthickness="{themeresource contentdialogborderwidth}"                 borderbrush="{themeresource systemcontrolforegroundaccentbrush}"                 maxwidth="{templatebinding maxwidth}"                 maxheight="{templatebinding maxheight}"                 minwidth="{templatebinding minwidth}"                 minheight="{templatebinding minheight}" >                             <grid x:name="dialogspace" verticalalignment="stretch">                                 <grid.rowdefinitions>                                     <rowdefinition height="auto" />                                     <rowdefinition height="*" />                                     <rowdefinition height="auto" />                                 </grid.rowdefinitions>                                 <scrollviewer x:name="contentscrollviewer"                     horizontalscrollbarvisibility="disabled"                     verticalscrollbarvisibility="disabled"                     zoommode="disabled"                     margin="{themeresource contentdialogcontentscrollviewermargin}"                     istabstop="false">                                     <grid>                                         <grid.rowdefinitions>                                             <rowdefinition height="auto" />                                             <rowdefinition height="auto" />                                         </grid.rowdefinitions>                                         <contentcontrol x:name="title"                     margin="{themeresource contentdialogtitlemargin}"                     content="{templatebinding title}"                     contenttemplate="{templatebinding titletemplate}"                     fontsize="20"                     fontfamily="xamlautofontfamily"                     fontweight="normal"                     foreground="{templatebinding foreground}"                     horizontalalignment="left"                     verticalalignment="top"                     istabstop="false"                     maxheight="{themeresource contentdialogtitlemaxheight}" >                                             <contentcontrol.template>                                                 <controltemplate targettype="contentcontrol">                                                     <contentpresenter                           content="{templatebinding content}"                           maxlines="2"                           textwrapping="wrap"                           contenttemplate="{templatebinding contenttemplate}"                           margin="{templatebinding padding}"                           contenttransitions="{templatebinding contenttransitions}"                           horizontalalignment="{templatebinding horizontalcontentalignment}"                           verticalalignment="{templatebinding verticalcontentalignment}" />                                                 </controltemplate>                                             </contentcontrol.template>                                         </contentcontrol>                                         <contentpresenter x:name="content"                     contenttemplate="{templatebinding contenttemplate}"                     content="{templatebinding content}"                     fontsize="{themeresource controlcontentthemefontsize}"                     fontfamily="{themeresource contentcontrolthemefontfamily}"                     margin="{themeresource contentdialogcontentmargin}"                     foreground="{templatebinding foreground}"                     grid.row="1"                     textwrapping="wrap" />                                     </grid>                                 </scrollviewer>                                 <grid x:name="commandspace" grid.row="1" horizontalalignment="stretch" verticalalignment="bottom">                                     <grid.columndefinitions>                                         <columndefinition/>                                         <columndefinition/>                                     </grid.columndefinitions>                                     <border x:name="button1host"                   margin="{themeresource contentdialogbutton1hostmargin}"                   minwidth="{themeresource contentdialogbuttonminwidth}"                   maxwidth="{themeresource contentdialogbuttonmaxwidth}"                   height="{themeresource contentdialogbuttonheight}"                   horizontalalignment="center" />                                 </grid>                             </grid>                         </border>                     </grid>                 </border>             </controltemplate>         </setter.value>     </setter> </style> 

i have change style , have 1 button call button1host when create content dialog nothing changed i've tryed copy code content dialog xaml using <page.resoures> got same value

hope me

find commandspace grid , set first column width 0.

<grid x:name="commandspace"       grid.row="1"       horizontalalignment="stretch"       verticalalignment="bottom">     <grid.columndefinitions>         <columndefinition width="0" />         <columndefinition />     </grid.columndefinitions>     <border x:name="button1host"             margin="{themeresource contentdialogbutton1hostmargin}"             minwidth="{themeresource contentdialogbuttonminwidth}"             minheight="{themeresource contentdialogbuttonminheight}" />     <border x:name="button2host"             margin="{themeresource contentdialogbutton2hostmargin}"             minwidth="{themeresource contentdialogbuttonminwidth}"             minheight="{themeresource contentdialogbuttonminheight}"             grid.column="1" /> </grid> 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -