Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit ba96c62

Browse files
committed
https://github.com/firstfloorsoftware/mui/pull/157
1 parent 4b1c543 commit ba96c62

3 files changed

Lines changed: 34 additions & 9 deletions

File tree

1.0/ModernUI/ModernUI.WPF4/Assets/ModernWindowStyles.xaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
<!-- Resource key 'EmptyWindow' is considered obsolete, use 'BlankWindow' instead (see below). EmptyWindow resource is kept here for backwards compatibility. -->
1616

17-
<!-- empty window style, no backbutton, menu and title links -->
17+
<!-- blank window style, no backbutton, menu and title links -->
1818
<Style x:Key="EmptyWindow" TargetType="controls:ModernWindow" BasedOn="{StaticResource {x:Type controls:ModernWindow}}" >
1919
<Setter Property="Padding" Value="8" />
2020
<Setter Property="IsTitleVisible" Value="True" />
2121
<Setter Property="Template">
2222
<Setter.Value>
2323
<ControlTemplate TargetType="controls:ModernWindow">
24-
<Border x:Name="WindowBorder" Margin="{Binding Source={x:Static shell:SystemParameters2.Current}, Path=WindowNonClientFrameThickness}">
24+
<Border x:Name="WindowBorder" Margin="{Binding Source={x:Static SystemParameters.WindowNonClientFrameThickness}}">
2525
<Border.Background>
2626
<SolidColorBrush x:Name="WindowBorderBackground" Color="{DynamicResource WindowBackgroundColor}" />
2727
</Border.Background>
@@ -50,7 +50,7 @@
5050
<Grid.ColumnDefinitions>
5151
<ColumnDefinition Width="*" />
5252
<ColumnDefinition Width="Auto" />
53-
<ColumnDefinition Width="96" />
53+
<ColumnDefinition Width="Auto" />
5454
</Grid.ColumnDefinitions>
5555

5656
<!-- title -->
@@ -67,7 +67,7 @@
6767

6868
<!-- window system buttons-->
6969
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Top" shell:WindowChrome.IsHitTestVisibleInChrome="True">
70-
<Button Command="{Binding Source={x:Static shell:SystemCommands.MinimizeWindowCommand}}" ToolTip="{x:Static modernui:Resources.Minimize}" Style="{StaticResource SystemButton}">
70+
<Button x:Name="Minimize" Command="{Binding Source={x:Static shell:SystemCommands.MinimizeWindowCommand}}" ToolTip="{x:Static modernui:Resources.Minimize}" Style="{StaticResource SystemButton}">
7171
<Button.Content>
7272
<Grid Width="13" Height="12" RenderTransform="1,0,0,1,0,1">
7373
<Path Data="M0,6 L8,6 Z" Width="8" Height="7" VerticalAlignment="Center" HorizontalAlignment="Center"
@@ -130,6 +130,11 @@
130130
<Setter TargetName="Maximize" Property="Visibility" Value="Visible" />
131131
<Setter TargetName="Restore" Property="Visibility" Value="Collapsed" />
132132
</Trigger>
133+
<Trigger Property="ResizeMode" Value="NoResize">
134+
<Setter TargetName="Maximize" Property="Visibility" Value="Collapsed" />
135+
<Setter TargetName="Minimize" Property="Visibility" Value="Collapsed" />
136+
<Setter TargetName="Restore" Property="Visibility" Value="Collapsed" />
137+
</Trigger>
133138
<MultiTrigger>
134139
<MultiTrigger.Conditions>
135140
<Condition Property="ResizeMode" Value="CanResizeWithGrip" />
@@ -145,4 +150,5 @@
145150

146151
<!-- Same as 'EmptyWindow', but a better resource name -->
147152
<Style x:Key="BlankWindow" TargetType="controls:ModernWindow" BasedOn="{StaticResource EmptyWindow}" />
153+
148154
</ResourceDictionary>

1.0/ModernUI/ModernUI.WPF4/ModernUI.WPF4.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>ModernUI</RootNamespace>
1111
<AssemblyName>ModernUI</AssemblyName>
12-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<SccProjectName>SAK</SccProjectName>
1515
<SccLocalPath>SAK</SccLocalPath>
1616
<SccAuxPath>SAK</SccAuxPath>
1717
<SccProvider>SAK</SccProvider>
18-
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
18+
<TargetFrameworkProfile>
19+
</TargetFrameworkProfile>
1920
</PropertyGroup>
2021
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2122
<DebugSymbols>true</DebugSymbols>
@@ -27,6 +28,7 @@
2728
<WarningLevel>4</WarningLevel>
2829
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2930
<DocumentationFile>bin\Debug\ModernUI.xml</DocumentationFile>
31+
<Prefer32Bit>false</Prefer32Bit>
3032
</PropertyGroup>
3133
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3234
<DebugType>pdbonly</DebugType>
@@ -37,6 +39,7 @@
3739
<WarningLevel>4</WarningLevel>
3840
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3941
<DocumentationFile>bin\Release\ModernUI.xml</DocumentationFile>
42+
<Prefer32Bit>false</Prefer32Bit>
4043
</PropertyGroup>
4144
<PropertyGroup>
4245
<SignAssembly>false</SignAssembly>

1.0/ModernUI/ModernUI.WPF4/Themes/ModernWindow.xaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<Setter Property="Template">
2929
<Setter.Value>
3030
<ControlTemplate TargetType="controls:ModernWindow">
31-
<Border x:Name="WindowBorder" Margin="{Binding Source={x:Static shell:SystemParameters2.Current}, Path=WindowNonClientFrameThickness}">
31+
<Border x:Name="WindowBorder" Margin="{Binding Source={x:Static SystemParameters.WindowNonClientFrameThickness}}">
3232
<Border.Background>
3333
<SolidColorBrush x:Name="WindowBorderBackground" Color="{DynamicResource WindowBackgroundColor}" />
3434
</Border.Background>
@@ -100,7 +100,7 @@
100100

101101
<!-- window system buttons-->
102102
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Top" shell:WindowChrome.IsHitTestVisibleInChrome="True">
103-
<Button Command="{Binding Source={x:Static shell:SystemCommands.MinimizeWindowCommand}}" ToolTip="{x:Static modernui:Resources.Minimize}" Style="{StaticResource SystemButton}">
103+
<Button x:Name="Minimize" Command="{Binding Source={x:Static shell:SystemCommands.MinimizeWindowCommand}}" ToolTip="{x:Static modernui:Resources.Minimize}" Style="{StaticResource SystemButton}">
104104
<Button.Content>
105105
<Grid Width="13" Height="12" RenderTransform="1,0,0,1,0,1">
106106
<Path Data="M0,6 L8,6 Z" Width="8" Height="7" VerticalAlignment="Center" HorizontalAlignment="Center"
@@ -187,6 +187,11 @@
187187
<Setter TargetName="Maximize" Property="Visibility" Value="Visible" />
188188
<Setter TargetName="Restore" Property="Visibility" Value="Collapsed" />
189189
</Trigger>
190+
<Trigger Property="ResizeMode" Value="NoResize">
191+
<Setter TargetName="Maximize" Property="Visibility" Value="Collapsed" />
192+
<Setter TargetName="Minimize" Property="Visibility" Value="Collapsed" />
193+
<Setter TargetName="Restore" Property="Visibility" Value="Collapsed" />
194+
</Trigger>
190195
<MultiTrigger>
191196
<MultiTrigger.Conditions>
192197
<Condition Property="ResizeMode" Value="CanResizeWithGrip" />
@@ -201,9 +206,20 @@
201206

202207
<Setter Property="shell:WindowChrome.WindowChrome">
203208
<Setter.Value>
204-
<shell:WindowChrome CornerRadius="0" GlassFrameThickness="1" UseAeroCaptionButtons="False" NonClientFrameEdges="None" />
209+
<shell:WindowChrome CornerRadius="0" GlassFrameThickness="1" UseAeroCaptionButtons="False" NonClientFrameEdges="None" />
205210
</Setter.Value>
206211
</Setter>
212+
213+
<Setter Property="shell:WindowChrome.IsHitTestVisibleInChrome" Value="False" />
214+
<Style.Triggers>
215+
<MultiTrigger>
216+
<MultiTrigger.Conditions>
217+
<Condition Property="ResizeMode" Value="NoResize" />
218+
<Condition Property="WindowState" Value="Maximized" />
219+
</MultiTrigger.Conditions>
220+
<Setter Property="shell:WindowChrome.IsHitTestVisibleInChrome" Value="True"/>
221+
</MultiTrigger>
222+
</Style.Triggers>
207223
</Style>
208224

209225
</ResourceDictionary>

0 commit comments

Comments
 (0)