Skip to content

Commit 7494f80

Browse files
committed
Merge pull request #1693 from MahApps/1580-maximize-button-display-issue
fix maximized state path display
2 parents 16b86b4 + adae310 commit 7494f80

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

MahApps.Metro/Themes/MetroWindow.xaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
<ResourceDictionary>
327327
<Style TargetType="{x:Type Button}">
328328
<Setter Property="Foreground"
329-
Value="{DynamicResource BlackBrush}"/>
329+
Value="{DynamicResource BlackBrush}" />
330330
<Setter Property="Background"
331331
Value="{DynamicResource TransparentWhiteBrush}" />
332332
<Setter Property="HorizontalContentAlignment"
@@ -540,9 +540,13 @@
540540
Mode="OneWay" />
541541
</MultiBinding>
542542
</Button.Visibility>
543-
<Path x:Name="MaxPath" SnapsToDevicePixels="True"
544-
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" >
545-
</Path>
543+
<!-- normal state -->
544+
<Path x:Name="PART_MaxPath"
545+
Width="10"
546+
Height="10"
547+
Data="F1M0,0L0,9 9,9 9,0 0,0 0,3 8,3 8,8 1,8 1,3z"
548+
SnapsToDevicePixels="True"
549+
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
546550
</Button>
547551

548552
<Button x:Name="PART_Close"
@@ -558,11 +562,11 @@
558562
</Button>
559563
</StackPanel>
560564
<ControlTemplate.Triggers>
561-
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}, Path=WindowState}" Value="Normal">
562-
<Setter TargetName="MaxPath" Property="Data" Value="F1M0,0L0,9 9,9 9,0 0,0 0,3 8,3 8,8 1,8 1,3z" />
563-
</DataTrigger>
564-
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}, Path=WindowState}" Value="Maximized">
565-
<Setter TargetName="MaxPath" Property="Data" Value="F1M0,10L0,3 3,3 3,0 10,0 10,2 4,2 4,3 7,3 7,6 6,6 6,5 1,5 1,10z M1,10L7,10 7,7 10,7 10,2 9,2 9,6 6,6 6,9 1,9z" />
565+
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}, Path=WindowState}"
566+
Value="Maximized">
567+
<Setter TargetName="PART_MaxPath"
568+
Property="Data"
569+
Value="F1M0,10L0,3 3,3 3,0 10,0 10,2 4,2 4,3 7,3 7,6 6,6 6,5 1,5 1,10z M1,10L7,10 7,7 10,7 10,2 9,2 9,6 6,6 6,9 1,9z" />
566570
</DataTrigger>
567571
</ControlTemplate.Triggers>
568572
</ControlTemplate>

0 commit comments

Comments
 (0)