How can I set style for titleBar which is applied WindowChrome

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 6 years ago by Joshua Li
Version: 13.1.0581
Avatar

How can I set style for titleBar which is applied WindowChrome, like background or title's fontsize? THX~

Comments (1)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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}}


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 9 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.