
How can I set style for titleBar which is applied WindowChrome, like background or title's fontsize? THX~
How can I set style for titleBar which is applied WindowChrome, like background or title's fontsize? THX~
Hi Joshua,
The title bar TextBlock is defined as:
<TextBlock x:Name="titleBarText" Grid.Column="1" Margin="0,2"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Title}"
FontFamily="{DynamicResource {x:Static SystemFonts.CaptionFontFamilyKey}}"
FontSize="{DynamicResource {x:Static SystemFonts.CaptionFontSizeKey}}"
FontStyle="{DynamicResource {x:Static SystemFonts.CaptionFontStyleKey}}"
FontWeight="{DynamicResource {x:Static themes:AssetResourceKeys.WindowTitleBarFontWeightKey}}"
Foreground="{DynamicResource {x:Static themes:AssetResourceKeys.WindowTitleBarForegroundActiveBrushKey}}"
TextTrimming="CharacterEllipsis" RenderOptions.ClearTypeHint="Enabled"
VerticalAlignment="Center" themes:WindowChrome.ElementKind="TitleBar" />
Some of those assets you can override in your App.Resources. But you can't do the size unless you clone the templates. We can give you the templates once you are a customer.
The title bar background can be changed by redefining this asset in your App.Resources:
{DynamicResource {x:Static themes:AssetResourceKeys.WindowTitleBarBackgroundActiveBrushKey}}
Please log in to a validated account to post comments.