c# 4.0 - Metro App Callisto Framework extend CustomDialog - Add TitleBackground -


does know how extend customdialog control callisto metro app framework, add titlebackground property?

effectively, colour background of row title appears.

figured out:

in customdialog.cs add:

 public brush titlebackground     {         { return (brush)getvalue(titlebackgroundproperty); }         set { setvalue(titlebackgroundproperty, value); }     }      public static readonly dependencyproperty titlebackgroundproperty =         dependencyproperty.register("titlebackground", typeof(brush), typeof(customdialog), null); 

and in generic.xaml, go customdialog style , change grid definition to:

                        <grid.columndefinitions>                             <columndefinition/>                             <columndefinition width="auto"/>                             <columndefinition/>                         </grid.columndefinitions>                         <grid.rowdefinitions>                             <rowdefinition height="80"/>                             <rowdefinition height="*"/>                         </grid.rowdefinitions>                         <rectangle grid.columnspan="3" grid.row="0" fill="{templatebinding titlebackground}"/>                         <button grid.column="0" grid.row="0" x:name="part_backbutton" horizontalalignment="right" verticalalignment="top" margin="0,24,0,0" style="{staticresource dialogbackbuttonstyle}" command="{templatebinding backbuttoncommand}" commandparameter="{templatebinding backbuttoncommandparameter}" visibility="{templatebinding backbuttonvisibility}"/>                         <local:dynamictextblock grid.column="1" grid.row="0" foreground="{templatebinding titleforeground}" x:name="part_title" text="{templatebinding title}" fontfamily="segoe ui" fontsize="26.6667" fontweight="light" margin="0,0,0,8" />                         <contentpresenter grid.column="1" grid.row="1" margin="0" x:name="part_content" foreground="{binding relativesource={relativesource mode=templatedparent}, path=background, converter={staticresource colorcontrast}}" /> 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -