Skip to content

Commit b42838d

Browse files
committed
Add HasWinUI2 condition and update PackageReference for Microsoft.UI.Xaml
1 parent ec68ac6 commit b42838d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

MultiTarget/MultiTargetIdentifiers.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,7 @@
6363
<WinUIMajorVersion Condition="'$(HasWinUI)' == 'true' AND '$(IsWinAppSdk)' == 'true' AND $(WinUIMajorVersion) == ''">3</WinUIMajorVersion>
6464

6565
<UseUwp Condition="'$(HasWinUI)' == 'true' AND '$(IsUwp)' == 'true' AND '$(MultiTargetPlatformIdentifier)' == 'windows'">true</UseUwp>
66+
67+
<HasWinUI2 Condition="'$(HasWinUI2)' == '' AND '$(HasWinUI)' == 'true' AND '$(WinUIMajorVersion)' == '2'">true</HasWinUI2>
6668
</PropertyGroup>
6769
</Project>

MultiTarget/PackageReferences/Uwp/Microsoft.UI.Xaml.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project>
22
<!-- Condition must be on a <When> statement in its own file for this to work in Visual Studio. https://stackoverflow.com/a/16557059 -->
33
<Choose>
4-
<When Condition="'$(HasWinUI)' == 'true' AND '$(MultiTargetPlatformIdentifier)' != 'windows'" >
4+
<When Condition="'$(HasWinUI2)' == 'true' AND '$(MultiTargetPlatformIdentifier)' != 'windows'" >
55
<ItemGroup>
66
<PackageReference Include="Microsoft.UI.Xaml" Version="2.8.6" />
77
</ItemGroup>
88
</When>
9-
<When Condition="'$(HasWinUI)' == 'true' AND '$(MultiTargetPlatformIdentifier)' == 'windows'" >
9+
<When Condition="'$(HasWinUI2)' == 'true' AND '$(MultiTargetPlatformIdentifier)' == 'windows'" >
1010
<ItemGroup>
1111
<!-- Prerelease version needed for TargetFramework support. Not needed by uap. -->
1212
<PackageReference Include="Microsoft.UI.Xaml" Version="2.8.7-prerelease.241119001" />

0 commit comments

Comments
 (0)