Skip to content

Commit c3933cc

Browse files
committedJul 5, 2022
Bring back old WinRT
1 parent da30e9b commit c3933cc

File tree

7 files changed

+39
-52
lines changed

7 files changed

+39
-52
lines changed
 

‎Directory.Build.targets

+32
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,36 @@
4444
<SupportedOSPlatform>7.0</SupportedOSPlatform>
4545
</PropertyGroup>
4646

47+
<Choose>
48+
<When Condition="'$(UseWinRT)' == 'true'">
49+
<Choose>
50+
<When Condition="$(DefineConstants.Contains('NET5_0_OR_NEWER'))" />
51+
<When Condition="$(DefineConstants.Contains('NET461_OR_NEWER'))">
52+
<ItemGroup>
53+
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.22000.196" />
54+
</ItemGroup>
55+
</When>
56+
<Otherwise>
57+
<ItemGroup>
58+
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.7.0" />
59+
<Reference Include="Windows">
60+
<HintPath>$(MSBuildThisFileDirectory)WinMD\Windows.WinMD</HintPath>
61+
<IsWinMDFile>true</IsWinMDFile>
62+
<Private>false</Private>
63+
</Reference>
64+
<Reference Include="Windows.Foundation.FoundationContract">
65+
<HintPath>$(MSBuildThisFileDirectory)WinMD\Windows.Foundation.FoundationContract.winmd</HintPath>
66+
<IsWinMDFile>true</IsWinMDFile>
67+
<Private>false</Private>
68+
</Reference>
69+
<Reference Include="Windows.Foundation.UniversalApiContract">
70+
<HintPath>$(MSBuildThisFileDirectory)WinMD\Windows.Foundation.UniversalApiContract.winmd</HintPath>
71+
<IsWinMDFile>true</IsWinMDFile>
72+
<Private>false</Private>
73+
</Reference>
74+
</ItemGroup>
75+
</Otherwise>
76+
</Choose>
77+
</When>
78+
</Choose>
4779
</Project>

‎ModernWpf.Controls/ModernWpf.Controls.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows7.0</TargetFrameworks>
4+
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows10.0.18362.0</TargetFrameworks>
55
<UseWPF>true</UseWPF>
66
<NeutralLanguage>en-US</NeutralLanguage>
77
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);GetDocumentationFile</TargetsForTfmSpecificBuildOutput>

‎ModernWpf.MahApps/ModernWpf.MahApps.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows7.0</TargetFrameworks>
4+
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows10.0.18362.0</TargetFrameworks>
55
<UseWPF>true</UseWPF>
66
<NeutralLanguage>en-US</NeutralLanguage>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>

‎ModernWpf.MessageBox/ModernWpf.MessageBox.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows7.0</TargetFrameworks>
4+
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows10.0.18362.0</TargetFrameworks>
55
<UseWPF>true</UseWPF>
66
<NeutralLanguage>en-US</NeutralLanguage>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>

‎ModernWpf/ModernWpf.csproj

+2-47
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows7.0</TargetFrameworks>
4+
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows10.0.18362.0</TargetFrameworks>
55
<UseWPF>true</UseWPF>
6+
<UseWinRT>true</UseWinRT>
67
<NeutralLanguage>en-US</NeutralLanguage>
78
<GenerateDocumentationFile>true</GenerateDocumentationFile>
89
<LangVersion>latest</LangVersion>
910
</PropertyGroup>
1011

11-
<PropertyGroup>
12-
<CsWinRTEmbedded>true</CsWinRTEmbedded>
13-
<CsWinRTWindowsMetadata>10.0.18362.0</CsWinRTWindowsMetadata>
14-
<CsWinRTIncludes>
15-
Windows.Foundation;
16-
Windows.UI.Color;
17-
Windows.UI.IColors;
18-
Windows.UI.ViewManagement.HandPreference;
19-
Windows.UI.ViewManagement.IUISettings;
20-
Windows.UI.ViewManagement.UIColorType;
21-
Windows.UI.ViewManagement.UIElementType;
22-
Windows.UI.ViewManagement.UISettings;
23-
</CsWinRTIncludes>
24-
<CsWinRTExcludes>
25-
Windows.Foundation.Diagnostics;
26-
Windows.Foundation.PropertyType;
27-
</CsWinRTExcludes>
28-
</PropertyGroup>
29-
30-
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '5.0'))">
31-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="1.6.4" />
32-
</ItemGroup>
33-
34-
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '3.0')) and $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '5.0')) or&#xD;&#xA; '$(TargetFrameworkIdentifier)' == '.NETFramework' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.6.1'))">
35-
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.18362.2005" />
36-
</ItemGroup>
37-
38-
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '4.6.1'))">
39-
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0" />
40-
<Reference Include="Windows">
41-
<HintPath>$(SolutionDir)WinMD\Windows.WinMD</HintPath>
42-
<IsWinMDFile>true</IsWinMDFile>
43-
<Private>false</Private>
44-
</Reference>
45-
<Reference Include="Windows.Foundation.FoundationContract">
46-
<HintPath>$(SolutionDir)WinMD\Windows.Foundation.FoundationContract.winmd</HintPath>
47-
<IsWinMDFile>true</IsWinMDFile>
48-
<Private>false</Private>
49-
</Reference>
50-
<Reference Include="Windows.Foundation.UniversalApiContract">
51-
<HintPath>$(SolutionDir)WinMD\Windows.Foundation.UniversalApiContract.winmd</HintPath>
52-
<IsWinMDFile>true</IsWinMDFile>
53-
<Private>false</Private>
54-
</Reference>
55-
</ItemGroup>
56-
5712
<ItemGroup Condition="!$(DefineConstants.Contains('NET47_OR_NEWER'))">
5813
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
5914
</ItemGroup>

‎samples/SamplesCommon/SamplesCommon.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net452;net462;netcoreapp3.1;net5.0-windows</TargetFrameworks>
4+
<TargetFrameworks>net452;net462;netcoreapp3.1;net5.0-windows10.0.18362.0</TargetFrameworks>
55
<UseWPF>true</UseWPF>
66
</PropertyGroup>
77

‎test/ModernWpf.MessageBox.Test/ModernWpf.MessageBox.Test.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows7.0</TargetFrameworks>
5+
<TargetFrameworks>net4.5.2;net4.6.2;netcoreapp3.1;net5.0-windows10.0.18362.0</TargetFrameworks>
66
<UseWPF>True</UseWPF>
77
<StartupObject></StartupObject>
88
</PropertyGroup>

0 commit comments

Comments
 (0)
Please sign in to comment.