Skip to content

Commit

Permalink
Fix maximize button not restore
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed Apr 7, 2024
1 parent 059f75c commit 3136028
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,11 @@ private void InitializeSnapLayout(TitleBarButton maximizeButton)

if (maximizeButton.IsEnabled && maximizeButton.Visibility == Visibility.Visible)
{
_snapLayout = new SnapLayout();
_snapLayout.Register(maximizeButton);
if(_snapLayout == null)
{
_snapLayout = new SnapLayout();
_snapLayout.Register(maximizeButton);
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<!--<Trigger Property="MaximizeButtonTouchOptimize" Value="False">
<Setter TargetName="CloseButton" Property="Height" Value="{Binding ElementName=PART_RightSystemOverlay, Path=ActualHeight}"/>
<Setter TargetName="MaximizeRestoreButton" Property="Height" Value="{Binding ElementName=PART_RightSystemOverlay, Path=ActualHeight}"/>
<Setter TargetName="MinimizeButton" Property="Height" Value="{Binding ElementName=PART_RightSystemOverlay, Path=ActualHeight}"/>
</Trigger>-->
<Trigger Property="IsActive" Value="False">
<Setter TargetName="LayoutRoot" Property="Background" Value="{Binding InactiveBackground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter TargetName="HighContrastBackground" Property="Fill" Value="{DynamicResource {x:Static SystemColors.InactiveCaptionBrushKey}}" />
Expand All @@ -162,12 +157,12 @@
</DataTrigger>
<DataTrigger Binding="{Binding ResizeMode, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" Value="CanMinimize">
<Setter TargetName="MaximizeRestoreButton" Property="IsEnabled" Value="False" />
</DataTrigger>
</DataTrigger>-->
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" Value="Maximized">
<Setter TargetName="MaximizeRestoreButton" Property="Content" Value="{StaticResource ChromeRestore}" />
<Setter TargetName="MaximizeRestoreButton" Property="Command" Value="{x:Static SystemCommands.RestoreWindowCommand}" />
<Setter TargetName="MaximizeRestoreButton" Property="AutomationProperties.Name" Value="Restore" />
</DataTrigger>-->
</DataTrigger>
<DataTrigger Binding="{Binding Path=(SystemParameters.HighContrast)}" Value="true">
<Setter TargetName="PART_BackButton" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
<Setter TargetName="Title" Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrushKey}}" />
Expand Down

0 comments on commit 3136028

Please sign in to comment.