Skip to content

Commit fa4dc25

Browse files
authored
Merge pull request #898 from punker76/feature/MahApps_v1.6
Update MaterialDesignTheme.MahApps for MahApps v1.6.5
2 parents 89c1ff2 + 46efaa1 commit fa4dc25

File tree

13 files changed

+391
-197
lines changed

13 files changed

+391
-197
lines changed

.paket/Paket.Restore.targets

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
1919
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
2020
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
21+
22+
<!-- .net core fdd -->
23+
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
24+
<PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
25+
26+
<!-- no extension is a shell script -->
27+
<PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand>
28+
2129
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
2230
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
2331
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
@@ -35,23 +43,26 @@
3543
<!-- Step 1 Check if lockfile is properly restored -->
3644
<PropertyGroup>
3745
<PaketRestoreRequired>true</PaketRestoreRequired>
38-
<NoWarn>$(NoWarn);NU1603</NoWarn>
46+
<NoWarn>$(NoWarn);NU1603;NU1604;NU1605;NU1608</NoWarn>
3947
</PropertyGroup>
4048

4149
<!-- Because ReadAllText is slow on osx/linux, try to find shasum and awk -->
4250
<PropertyGroup>
43-
<PaketRestoreCachedHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreCachedHasher)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum $(PaketRestoreCacheFile) | /usr/bin/awk '{ print $1 }'</PaketRestoreCachedHasher>
44-
<PaketRestoreLockFileHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreLockFileHash)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum $(PaketLockFilePath) | /usr/bin/awk '{ print $1 }'</PaketRestoreLockFileHasher>
51+
<PaketRestoreCachedHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreCachedHasher)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum "$(PaketRestoreCacheFile)" | /usr/bin/awk '{ print $1 }'</PaketRestoreCachedHasher>
52+
<PaketRestoreLockFileHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreLockFileHash)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum "$(PaketLockFilePath)" | /usr/bin/awk '{ print $1 }'</PaketRestoreLockFileHasher>
4553
</PropertyGroup>
4654

4755
<!-- If shasum and awk exist get the hashes -->
48-
<Exec Condition=" '$(PaketRestoreCachedHasher)' != '' " Command="$(PaketRestoreCachedHasher)" ConsoleToMSBuild='true'>
49-
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreCachedHash" />
56+
<Exec StandardOutputImportance="Low" Condition=" '$(PaketRestoreCachedHasher)' != '' " Command="$(PaketRestoreCachedHasher)" ConsoleToMSBuild='true'>
57+
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreCachedHash" />
5058
</Exec>
51-
<Exec Condition=" '$(PaketRestoreLockFileHasher)' != '' " Command="$(PaketRestoreLockFileHasher)" ConsoleToMSBuild='true'>
52-
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" />
59+
<Exec StandardOutputImportance="Low" Condition=" '$(PaketRestoreLockFileHasher)' != '' " Command="$(PaketRestoreLockFileHasher)" ConsoleToMSBuild='true'>
60+
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" />
5361
</Exec>
5462

63+
<!-- Debug whats going on -->
64+
<Message Importance="low" Text="calling paket restore with targetframework=$(TargetFramework) targetframeworks=$(TargetFrameworks)" />
65+
5566
<PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
5667
<!-- if no hash has been done yet fall back to just reading in the files and comparing them -->
5768
<PaketRestoreCachedHash Condition=" '$(PaketRestoreCachedHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
@@ -61,11 +72,22 @@
6172
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
6273
</PropertyGroup>
6374

75+
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.174.2' ">
76+
<PaketRestoreRequired>true</PaketRestoreRequired>
77+
</PropertyGroup>
78+
6479
<!-- Do a global restore if required -->
6580
<Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
6681
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
6782

6883
<!-- Step 2 Detect project specific changes -->
84+
<ItemGroup>
85+
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
86+
<!-- Don't include all frameworks when msbuild explicitly asks for a single one -->
87+
<MyTargetFrameworks Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' == '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
88+
<PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
89+
</ItemGroup>
90+
<Message Importance="low" Text="MyTargetFrameworks=@(MyTargetFrameworks) PaketResolvedFilePaths=@(PaketResolvedFilePaths)" />
6991
<PropertyGroup>
7092
<PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
7193
<!-- MyProject.fsproj.paket.references has the highest precedence -->
@@ -74,7 +96,9 @@
7496
<PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketOriginalReferencesFilePath>
7597
<!-- paket.references -->
7698
<PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\paket.references</PaketOriginalReferencesFilePath>
77-
<PaketResolvedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).$(TargetFramework).paket.resolved</PaketResolvedFilePath>
99+
100+
<DoAllResolvedFilesExist>false</DoAllResolvedFilesExist>
101+
<DoAllResolvedFilesExist Condition="Exists(%(PaketResolvedFilePaths.Identity))">true</DoAllResolvedFilesExist>
78102
<PaketRestoreRequired>true</PaketRestoreRequired>
79103
<PaketRestoreRequiredReason>references-file-or-cache-not-found</PaketRestoreRequiredReason>
80104
</PropertyGroup>
@@ -93,32 +117,39 @@
93117
</PropertyGroup>
94118

95119
<!-- Step 2 b detect relevant changes in project file (new targetframework) -->
96-
<PropertyGroup Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' ">
120+
<PropertyGroup Condition=" '$(DoAllResolvedFilesExist)' != 'true' ">
97121
<PaketRestoreRequired>true</PaketRestoreRequired>
98-
<PaketRestoreRequiredReason>target-framework '$(TargetFramework)'</PaketRestoreRequiredReason>
122+
<PaketRestoreRequiredReason>target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths)</PaketRestoreRequiredReason>
99123
</PropertyGroup>
100124

101125
<!-- Step 3 Restore project specific stuff if required -->
102126
<Message Condition=" '$(PaketRestoreRequired)' == 'true' " Importance="low" Text="Detected a change ('$(PaketRestoreRequiredReason)') in the project file '$(MSBuildProjectFullPath)', calling paket restore" />
103-
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)"' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
127+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" />
128+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" />
104129

105130
<!-- This shouldn't actually happen, but just to be sure. -->
106-
<Error Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' AND '$(ResolveNuGetPackages)' != 'False' " Text="Paket file '$(PaketResolvedFilePath)' is missing while restoring $(MSBuildProjectFile). Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />
131+
<PropertyGroup>
132+
<DoAllResolvedFilesExist>false</DoAllResolvedFilesExist>
133+
<DoAllResolvedFilesExist Condition="Exists(%(PaketResolvedFilePaths.Identity))">true</DoAllResolvedFilesExist>
134+
</PropertyGroup>
135+
<Error Condition=" '$(DoAllResolvedFilesExist)' != 'true' AND '$(ResolveNuGetPackages)' != 'False' " Text="One Paket file '@(PaketResolvedFilePaths)' is missing while restoring $(MSBuildProjectFile). Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />
107136

108137
<!-- Step 4 forward all msbuild properties (PackageReference, DotNetCliToolReference) to msbuild -->
109-
<ReadLinesFromFile Condition="Exists('$(PaketResolvedFilePath)')" File="$(PaketResolvedFilePath)" >
138+
<ReadLinesFromFile Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketResolvedFilePaths)' != ''" File="%(PaketResolvedFilePaths.Identity)" >
110139
<Output TaskParameter="Lines" ItemName="PaketReferencesFileLines"/>
111140
</ReadLinesFromFile>
112141

113-
<ItemGroup Condition=" Exists('$(PaketResolvedFilePath)') AND '@(PaketReferencesFileLines)' != '' " >
142+
<ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " >
114143
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
115144
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
116145
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
117146
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
118147
</PaketReferencesFileLinesInfo>
119148
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
120149
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
121-
<PrivateAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'true'">All</PrivateAssets>
150+
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
151+
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
152+
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
122153
</PackageReference>
123154
</ItemGroup>
124155

@@ -140,9 +171,10 @@
140171
</DotNetCliToolReference>
141172
</ItemGroup>
142173

174+
<!-- Disabled for now until we know what to do with runtime deps - https://github.com/fsprojects/Paket/issues/2964
143175
<PropertyGroup>
144176
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
145-
</PropertyGroup>
177+
</PropertyGroup> -->
146178

147179
</Target>
148180

@@ -174,8 +206,8 @@
174206

175207
<ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
176208
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
177-
</ConvertToAbsolutePath>
178-
209+
</ConvertToAbsolutePath>
210+
179211

180212
<!-- Call Pack -->
181213
<PackTask Condition="$(UseNewPack)"

.paket/paket-sha256.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8996429163A399AA2F2E675D29F668E72597EB836187FE404A29936793ACC6D2 paket.exe

.paket/paket.bootstrapper.exe

0 Bytes
Binary file not shown.

.paket/paket.exe

283 KB
Binary file not shown.

MahMaterialDragablzMashUp/DialogsViewModel.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ private void InputDialog()
3737
var metroDialogSettings = new MetroDialogSettings
3838
{
3939
CustomResourceDictionary = DialogDictionary,
40-
NegativeButtonText = "CANCEL",
41-
SuppressDefaultResources = true
40+
NegativeButtonText = "CANCEL"
4241
};
4342

4443
DialogCoordinator.Instance.ShowInputAsync(this, "MahApps Dialog", "Using Material Design Themes", metroDialogSettings);
@@ -49,8 +48,7 @@ private async void ProgressDialog()
4948
var metroDialogSettings = new MetroDialogSettings
5049
{
5150
CustomResourceDictionary = DialogDictionary,
52-
NegativeButtonText = "CANCEL",
53-
SuppressDefaultResources = true
51+
NegativeButtonText = "CANCEL"
5452
};
5553

5654
var controller = await DialogCoordinator.Instance.ShowProgressAsync(this, "MahApps Dialog", "Using Material Design Themes (WORK IN PROGRESS)", true, metroDialogSettings);

MahMaterialDragablzMashUp/Mah.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
<controls:ToggleSwitch IsChecked="True" HorizontalAlignment="Left" />
1717
<Button Width="100" Margin="0 8 0 0" Content="Nice" HorizontalAlignment="Left"
1818
Style="{DynamicResource AccentedSquareButtonStyle}" />
19-
<controls:RangeSlider Margin="0 16 0 0" LowerValue="25" UpperValue="75" />
19+
<Slider Margin="6 16 6 0" TickPlacement="BottomRight" TickFrequency="10" />
20+
<controls:RangeSlider Margin="6 16 6 0" LowerValue="25" UpperValue="75" TickPlacement="BottomRight" TickFrequency="10" />
2021
<controls:RangeSlider Margin="0 16 0 0" LowerValue="25" UpperValue="75" Orientation="Vertical" Height="200" />
2122
<controls:NumericUpDown Margin="5"/>
2223
<controls:NumericUpDown Culture="ar-EG" FlowDirection="RightToLeft" Margin="5"/>

MahMaterialDragablzMashUp/MahAppsDragablzDemo.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1515
<WarningLevel>4</WarningLevel>
1616
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
17+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1718
</PropertyGroup>
1819
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1920
<PlatformTarget>AnyCPU</PlatformTarget>

MainDemo.Wpf/MaterialDesignDemo.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<FileAlignment>512</FileAlignment>
1414
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1515
<WarningLevel>4</WarningLevel>
16+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1617
</PropertyGroup>
1718
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1819
<PlatformTarget>AnyCPU</PlatformTarget>

MaterialDesignColors.Wpf.Tests/MaterialDesignColors.Wpf.Tests.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
<None Include="paket.references" />
5656
</ItemGroup>
5757
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
58+
<Choose>
59+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.2')">
60+
<PropertyGroup>
61+
<__paket__xunit_runner_visualstudio_props>net20\xunit.runner.visualstudio</__paket__xunit_runner_visualstudio_props>
62+
</PropertyGroup>
63+
</When>
64+
</Choose>
65+
<Import Project="..\packages\xunit.runner.visualstudio\build\$(__paket__xunit_runner_visualstudio_props).props" Condition="Exists('..\packages\xunit.runner.visualstudio\build\$(__paket__xunit_runner_visualstudio_props).props')" Label="Paket" />
5866
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
5967
Other similar extension points exist, see Microsoft.Common.targets.
6068
<Target Name="BeforeBuild">

MaterialDesignThemes.MahApps/Themes/MaterialDesignTheme.MahApps.Dialogs.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77

88
<Style BasedOn="{StaticResource MaterialDesignFlatButton}"
99
TargetType="{x:Type Button}" />
10+
<Style BasedOn="{StaticResource MaterialDesignFlatButton}"
11+
TargetType="{x:Type ButtonBase}" />
1012

1113
<Style x:Key="AccentedDialogSquareButton"
1214
BasedOn="{StaticResource MaterialDesignFlatButton}"
13-
TargetType="{x:Type Button}" />
15+
TargetType="{x:Type ButtonBase}" />
1416

1517
<Style x:Key="AccentedDialogHighlightedSquareButton"
1618
BasedOn="{StaticResource MaterialDesignFlatButton}"
17-
TargetType="{x:Type Button}"/>
19+
TargetType="{x:Type ButtonBase}"/>
1820

1921
</ResourceDictionary>

0 commit comments

Comments
 (0)