|
39 | 39 | <RowDefinition Height="Auto" />
|
40 | 40 | <RowDefinition Height="*" />
|
41 | 41 | </Grid.RowDefinitions>
|
42 |
| - <control:SmallPanel Grid.Row="0" Background="{TemplateBinding TitleBackground}"> |
43 |
| - <Grid x:Name="PART_GridChrome" Height="{TemplateBinding TitleHeight}"> |
| 42 | + <control:SmallPanel |
| 43 | + x:Name="PART_Normal" |
| 44 | + Grid.Row="0" |
| 45 | + Background="{TemplateBinding TitleBackground}"> |
| 46 | + <Grid Height="{TemplateBinding TitleHeight}"> |
| 47 | + <Grid.ColumnDefinitions> |
| 48 | + <ColumnDefinition Width="*" /> |
| 49 | + <ColumnDefinition Width="Auto" /> |
| 50 | + </Grid.ColumnDefinitions> |
| 51 | + <StackPanel Orientation="Horizontal"> |
| 52 | + <Button |
| 53 | + x:Name="PART_TitleBarIcon" |
| 54 | + Margin="5,0,0,0" |
| 55 | + VerticalAlignment="Center" |
| 56 | + shell:WindowChrome.IsHitTestVisibleInChrome="True" |
| 57 | + Background="Transparent" |
| 58 | + BorderThickness="0" |
| 59 | + Visibility="{Binding Icon, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource ObjectNullToVisibilityConverter}}"> |
| 60 | + <Image |
| 61 | + Width="{x:Static SystemParameters.SmallIconWidth}" |
| 62 | + Height="{x:Static SystemParameters.SmallIconHeight}" |
| 63 | + IsHitTestVisible="False" |
| 64 | + RenderOptions.BitmapScalingMode="HighQuality" |
| 65 | + Source="{TemplateBinding Icon}" /> |
| 66 | + </Button> |
| 67 | + |
| 68 | + <ContentControl |
| 69 | + Margin="5,0,0,0" |
| 70 | + VerticalAlignment="Center" |
| 71 | + Content="{TemplateBinding Title}" |
| 72 | + FontSize="{DynamicResource {x:Static SystemFonts.CaptionFontSizeKey}}" |
| 73 | + Foreground="{DynamicResource WD.WindowForegroundColorBrush}" |
| 74 | + IsTabStop="False" /> |
| 75 | + </StackPanel> |
| 76 | + <StackPanel |
| 77 | + Grid.Column="1" |
| 78 | + HorizontalAlignment="Right" |
| 79 | + VerticalAlignment="Top" |
| 80 | + shell:WindowChrome.IsHitTestVisibleInChrome="True" |
| 81 | + Orientation="Horizontal"> |
| 82 | + <StackPanel x:Name="PART_TitleBarMinAndMax" Orientation="Horizontal"> |
| 83 | + <Button |
| 84 | + Name="PART_TitleBarMinimizeButton" |
| 85 | + Padding="0" |
| 86 | + Command="{Binding Source={x:Static shell:SystemCommands.MinimizeWindowCommand}}" |
| 87 | + IsTabStop="False" |
| 88 | + Style="{DynamicResource WD.WindowButtonStyle}" |
| 89 | + ToolTip="{Binding [Minimize], Source={x:Static resx:LanguageManager.Instance}}"> |
| 90 | + <Grid HorizontalAlignment="Center" VerticalAlignment="Center"> |
| 91 | + <Rectangle |
| 92 | + Width="10" |
| 93 | + Height="1" |
| 94 | + Margin="0,7,0,0" |
| 95 | + VerticalAlignment="Bottom" |
| 96 | + Fill="{DynamicResource WD.WindowForegroundColorBrush}" /> |
| 97 | + </Grid> |
| 98 | + </Button> |
| 99 | + <Button |
| 100 | + Name="PART_TitleBarMaximizeButton" |
| 101 | + Padding="0" |
| 102 | + Command="{Binding Source={x:Static shell:SystemCommands.MaximizeWindowCommand}}" |
| 103 | + IsTabStop="False" |
| 104 | + Style="{DynamicResource WD.WindowButtonStyle}" |
| 105 | + ToolTip="{Binding [Maximize], Source={x:Static resx:LanguageManager.Instance}}"> |
| 106 | + <Grid HorizontalAlignment="Center" VerticalAlignment="Center"> |
| 107 | + <Path |
| 108 | + Width="10" |
| 109 | + Height="10" |
| 110 | + HorizontalAlignment="Center" |
| 111 | + VerticalAlignment="Center" |
| 112 | + Data="{DynamicResource WD.WindowMaximizeGeometry}" |
| 113 | + Fill="{DynamicResource WD.WindowForegroundColorBrush}" |
| 114 | + Stretch="Uniform" |
| 115 | + UseLayoutRounding="False" /> |
| 116 | + </Grid> |
| 117 | + </Button> |
| 118 | + <Button |
| 119 | + Name="PART_TitleBarRestoreButton" |
| 120 | + Padding="0" |
| 121 | + Command="{Binding Source={x:Static shell:SystemCommands.RestoreWindowCommand}}" |
| 122 | + IsTabStop="False" |
| 123 | + Style="{DynamicResource WD.WindowButtonStyle}" |
| 124 | + ToolTip="{Binding [Restore], Source={x:Static resx:LanguageManager.Instance}}" |
| 125 | + Visibility="Collapsed"> |
| 126 | + <Grid HorizontalAlignment="Center" VerticalAlignment="Center"> |
| 127 | + <Path |
| 128 | + Width="10" |
| 129 | + Height="10" |
| 130 | + HorizontalAlignment="Center" |
| 131 | + VerticalAlignment="Center" |
| 132 | + Data="{DynamicResource WD.WindowRestoreGeometry}" |
| 133 | + Fill="{DynamicResource WD.WindowForegroundColorBrush}" |
| 134 | + Stretch="Uniform" |
| 135 | + UseLayoutRounding="False" /> |
| 136 | + </Grid> |
| 137 | + </Button> |
| 138 | + </StackPanel> |
| 139 | + |
| 140 | + <Button |
| 141 | + Name="PART_TitleBarCloseButton" |
| 142 | + Command="{Binding Source={x:Static shell:SystemCommands.CloseWindowCommand}}" |
| 143 | + IsTabStop="False" |
| 144 | + Style="{DynamicResource WD.WindowButtonStyle}" |
| 145 | + ToolTip="{Binding [Close], Source={x:Static resx:LanguageManager.Instance}}"> |
| 146 | + <Path |
| 147 | + Width="10" |
| 148 | + Height="10" |
| 149 | + HorizontalAlignment="Center" |
| 150 | + VerticalAlignment="Center" |
| 151 | + Data="{DynamicResource WD.WindowCloseGeometry}" |
| 152 | + Fill="{DynamicResource WD.WindowForegroundColorBrush}" |
| 153 | + Stretch="Uniform" /> |
| 154 | + </Button> |
| 155 | + </StackPanel> |
| 156 | + </Grid> |
| 157 | + </control:SmallPanel> |
| 158 | + <control:SmallPanel |
| 159 | + x:Name="PART_HighTitleBar" |
| 160 | + Grid.Row="0" |
| 161 | + Background="{TemplateBinding TitleBackground}" |
| 162 | + Visibility="Collapsed"> |
| 163 | + <Grid |
| 164 | + x:Name="PART_GridChrome" |
| 165 | + Height="{TemplateBinding TitleHeight}" |
| 166 | + Margin="10,0,0,0"> |
44 | 167 | <Grid.ColumnDefinitions>
|
45 | 168 | <ColumnDefinition Width="Auto" />
|
46 | 169 | <ColumnDefinition Width="*" />
|
47 | 170 | <ColumnDefinition Width="Auto" MinWidth="30" />
|
48 | 171 | </Grid.ColumnDefinitions>
|
49 | 172 | <Image
|
50 |
| - Width="30" |
51 |
| - Height="30" |
52 |
| - Margin="14,0,0,0" |
53 |
| - HorizontalAlignment="Left" |
| 173 | + Width="23" |
| 174 | + Height="23" |
54 | 175 | VerticalAlignment="Center"
|
55 | 176 | RenderOptions.BitmapScalingMode="HighQuality"
|
56 | 177 | Source="{TemplateBinding Icon}"
|
57 |
| - Stretch="Fill" |
58 | 178 | Visibility="{TemplateBinding Icon,
|
59 | 179 | Converter={StaticResource ObjectNullToVisibilityConverter}}" />
|
60 | 180 | <TextBlock
|
|
65 | 185 | FontSize="{DynamicResource WD.TitleFontSize}"
|
66 | 186 | Foreground="{DynamicResource WD.WindowForegroundColorBrush}"
|
67 | 187 | Text="{TemplateBinding Title}" />
|
68 |
| - <WrapPanel |
| 188 | + <StackPanel |
69 | 189 | Grid.Column="2"
|
70 | 190 | Margin="0,6"
|
71 |
| - shell:WindowChrome.IsHitTestVisibleInChrome="True"> |
72 |
| - <WrapPanel x:Name="PART_MinAndMax"> |
| 191 | + shell:WindowChrome.IsHitTestVisibleInChrome="True" |
| 192 | + Orientation="Horizontal"> |
| 193 | + <StackPanel x:Name="PART_MinAndMax" Orientation="Horizontal"> |
73 | 194 | <Button
|
74 | 195 | Name="PART_MinimizeButton"
|
75 | 196 | Padding="0"
|
|
126 | 247 | UseLayoutRounding="False" />
|
127 | 248 | </Grid>
|
128 | 249 | </Button>
|
129 |
| - </WrapPanel> |
| 250 | + </StackPanel> |
130 | 251 |
|
131 | 252 | <Button
|
132 | 253 | Name="PART_CloseButton"
|
|
143 | 264 | Fill="{DynamicResource WD.WindowForegroundColorBrush}"
|
144 | 265 | Stretch="Uniform" />
|
145 | 266 | </Button>
|
146 |
| - </WrapPanel> |
| 267 | + </StackPanel> |
147 | 268 | </Grid>
|
148 | 269 | <ContentPresenter
|
149 | 270 | x:Name="PART_TitleToolBar"
|
|
165 | 286 | </Grid>
|
166 | 287 | </Border>
|
167 | 288 | <ControlTemplate.Triggers>
|
| 289 | + <Trigger Property="TitleBarMode" Value="HighTitleBar"> |
| 290 | + <Setter TargetName="PART_HighTitleBar" Property="Visibility" Value="Visible" /> |
| 291 | + <Setter TargetName="PART_Normal" Property="Visibility" Value="Collapsed" /> |
| 292 | + </Trigger> |
168 | 293 | <Trigger Property="WindowState" Value="Maximized">
|
169 | 294 | <Setter TargetName="PART_RestoreButton" Property="Visibility" Value="Visible" />
|
170 | 295 | <Setter TargetName="PART_MaximizeButton" Property="Visibility" Value="Collapsed" />
|
| 296 | + <Setter TargetName="PART_TitleBarRestoreButton" Property="Visibility" Value="Visible" /> |
| 297 | + <Setter TargetName="PART_TitleBarMaximizeButton" Property="Visibility" Value="Collapsed" /> |
171 | 298 | <Setter TargetName="PART_Border" Property="Margin" Value="7" />
|
172 | 299 | </Trigger>
|
173 | 300 | <Trigger Property="WindowStyle" Value="ToolWindow">
|
174 | 301 | <Setter TargetName="PART_MinAndMax" Property="Visibility" Value="Collapsed" />
|
| 302 | + <Setter TargetName="PART_TitleBarMinAndMax" Property="Visibility" Value="Collapsed" /> |
175 | 303 | </Trigger>
|
176 | 304 | <Trigger Property="NoChrome" Value="True">
|
177 | 305 | <Setter TargetName="PART_GridChrome" Property="Visibility" Value="Collapsed" />
|
178 | 306 | <Setter TargetName="PART_TitleToolBar" Property="Visibility" Value="Visible" />
|
179 | 307 | </Trigger>
|
| 308 | + |
180 | 309 | <MultiTrigger>
|
181 | 310 | <MultiTrigger.Conditions>
|
182 | 311 | <Condition Property="ResizeMode" Value="CanResizeWithGrip" />
|
|
0 commit comments