xaml - Callisto Custom Dialog Custom Styling for Windows App -
is there way customize styling of callisto custom dialog other background? want change font size , color of title property of custom dialog. suggestions without messing base style?
reference: https://github.com/timheuer/callisto/wiki/customdialog
the customdialog's template calculates it's title's foreground colour contrasts background , sets fontsize 26.6667:
<stackpanel margin="13,19,13,25" horizontalalignment="center" width="{templatebinding width}" maxwidth="680"> <local:dynamictextblock foreground="{binding relativesource={relativesource mode=templatedparent}, path=background, converter={staticresource colorcontrast}}" x:name="part_title" text="{templatebinding title}" fontfamily="segoe ui" fontsize="26.6667" fontweight="light" margin="0,0,0,8" /> <contentpresenter margin="0" x:name="part_content" foreground="{binding relativesource={relativesource mode=templatedparent}, path=background, converter={staticresource colorcontrast}}" /> </stackpanel>
if want change these you'll need retemplate dialog. can copy template callisto's generic.xaml , replace foreground , fontsize properties. may want use templatebinding can set them on customdialog when call it:
<stackpanel margin="9,5" horizontalalignment="center" width="{templatebinding width}" maxwidth="680"> <callisto:dynamictextblock foreground="{templatebinding foreground}" x:name="part_title" text="{templatebinding title}" fontfamily="segoe ui" fontsize="{templatebinding fontsize}" fontweight="light" margin="0,0,0,8" /> <contentpresenter margin="0" x:name="part_content" foreground="{templatebinding foreground}" /> </stackpanel>
then set them own resources:
<callisto:customdialog background="{themeresource mycustomdialogbackground}" foreground="{themeresource mycustomdialogforeground}" title="lorem ipsum" template="{staticresource customdialogcontroltemplate1}"></callisto:customdialog>
Comments
Post a Comment