Fixes #407 (partially) and #441 Description of the changes: Remove TitleBarHelper and all <Border x:Name="CustomTitleBar" /> Let the system defines the draggable region Centralize all events and functions associated to the title bar in a single control TitleBar instead of code splitted between MainPage/TitleBar/HistoryList/Memory. Use the standard title bar when high contrast is activated instead of the custom one. Modify the color of the title when the window doesn't have focus Fix the right padding of the title bar with high contrast How changes were validated: Manually tested with LtR and RtL languages Manually tested with high contrast Tested when History and Memory flyout are opened
31 lines
1.4 KiB
XML
31 lines
1.4 KiB
XML
<UserControl x:Class="CalculatorApp.TitleBar"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d">
|
|
<Grid x:Name="LayoutRoot"
|
|
Height="32"
|
|
HorizontalAlignment="Stretch">
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="WindowFocusStates">
|
|
<VisualState x:Name="WindowFocused"/>
|
|
<VisualState x:Name="WindowNotFocused">
|
|
<VisualState.Setters>
|
|
<Setter Target="AppName.Foreground" Value="{ThemeResource SystemControlForegroundChromeDisabledLowBrush}"/>
|
|
</VisualState.Setters>
|
|
</VisualState>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
<TextBlock x:Name="AppName"
|
|
x:Uid="AppName"
|
|
Margin="12,0,12,0"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
Foreground="{ThemeResource TitleBarForegroundBaseHighBrush}"
|
|
FontSize="12"
|
|
TextAlignment="Left"
|
|
TextTrimming="CharacterEllipsis"/>
|
|
</Grid>
|
|
</UserControl>
|