Skip to content

Commit b7fd380

Browse files
committed
Adjust .csprojs
1 parent 6f954f9 commit b7fd380

2 files changed

Lines changed: 52 additions & 14 deletions

File tree

ProjectHeads/AllComponents/Uno/CommunityToolkit.App.Uno.csproj

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
<IsPackable>false</IsPackable>
1111
<RootNamespace>CommunityToolkit.App.Uno</RootNamespace>
12+
<ImplicitUsings>enable</ImplicitUsings>
1213

1314
<!-- Platform flags for Generated/*.props project reference conditions -->
1415
<IsDeployableHead>true</IsDeployableHead>
@@ -19,19 +20,38 @@
1920
<IsAllExperimentHead>true</IsAllExperimentHead>
2021
<DependencyVariant>WinUI</DependencyVariant>
2122

22-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
23-
<EnableDefaultUnoItems>false</EnableDefaultUnoItems>
24-
<DefineConstants>$(DefineConstants);WINUI3</DefineConstants>
23+
<DefineConstants>$(DefineConstants);WINUI3;WINAPPSDK</DefineConstants>
2524
</PropertyGroup>
2625

27-
<!-- Required for shared app code global usings and platform constants -->
28-
<Import Project="$(ToolingDirectory)\MultiTarget\DefinedConstants.props" />
29-
<Import Project="$(ToolingDirectory)\MultiTarget\GlobalUsings.props" />
26+
<!-- Global usings for WinUI XAML namespaces -->
27+
<ItemGroup>
28+
<Using Include="Microsoft.UI.Xaml" />
29+
<Using Include="Microsoft.UI.Xaml.Controls" />
30+
<Using Include="Microsoft.UI.Xaml.Controls.Primitives" />
31+
<Using Include="Microsoft.UI.Xaml.Data" />
32+
<Using Include="Microsoft.UI.Xaml.Input" />
33+
<Using Include="Microsoft.UI.Xaml.Markup" />
34+
<Using Include="Microsoft.UI.Xaml.Media" />
35+
<Using Include="Microsoft.UI.Xaml.Media.Animation" />
36+
<Using Include="Microsoft.UI.Xaml.Navigation" />
37+
<Using Include="Microsoft.UI.Xaml.Automation" />
38+
<Using Include="Microsoft.UI.Xaml.Automation.Peers" />
39+
<Using Include="Windows.Foundation" />
40+
<Using Include="Windows.Foundation.Collections" />
41+
<Using Include="System.Runtime.InteropServices.WindowsRuntime" />
42+
<Using Include="Microsoft.UI.Xaml.Controls" Alias="MUXC" />
43+
</ItemGroup>
3044

3145
<!-- Auto-generated project references -->
3246
<Import Project="$(ToolingDirectory)\MultiTarget\Generated\*.Samples.props" />
3347
<Import Project="$(ToolingDirectory)\MultiTarget\Generated\*.Source.props" />
3448

49+
<!-- For Uno TFMs, force project references to resolve to net9.0 (not windows-specific) -->
50+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != ''">
51+
<ProjectReference Update="..\..\src\*.csproj" SetTargetFramework="TargetFramework=net9.0" />
52+
<ProjectReference Update="..\..\samples\*.csproj" SetTargetFramework="TargetFramework=net9.0" />
53+
</ItemGroup>
54+
3555
<!-- Shared app code -->
3656
<Import Project="$(ToolingDirectory)\CommunityToolkit.App.Shared\CommunityToolkit.App.Shared.projitems" Label="Shared" />
3757
<Import Project="$(ToolingDirectory)\ProjectHeads\Targets\AddMultiTargetCompatibleSampleDocs.targets" />
@@ -63,7 +83,6 @@
6383
<!-- Uno app dependencies -->
6484
<ItemGroup>
6585
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Interactivity.WinUI" Version="3.0.3" />
66-
<PackageReference Include="Uno.WinUI.Lottie" Version="6.4.242" />
6786
</ItemGroup>
6887

6988
<!-- Sample doc content inclusion -->

ProjectHeads/SingleComponent/Uno/ProjectTemplate.Uno.csproj

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
</UnoFeatures>
99

1010
<IsPackable>false</IsPackable>
11+
<ImplicitUsings>enable</ImplicitUsings>
1112

1213
<!-- Platform flags for project reference conditions -->
1314
<IsDeployableHead>true</IsDeployableHead>
@@ -18,21 +19,40 @@
1819
<IsSingleExperimentHead>true</IsSingleExperimentHead>
1920
<DependencyVariant>WinUI</DependencyVariant>
2021

21-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
22-
<EnableDefaultUnoItems>false</EnableDefaultUnoItems>
23-
<DefineConstants>$(DefineConstants);WINUI3</DefineConstants>
22+
<DefineConstants>$(DefineConstants);WINUI3;WINAPPSDK</DefineConstants>
2423
</PropertyGroup>
2524

26-
<!-- Required for shared app code global usings and platform constants -->
27-
<Import Project="$(ToolingDirectory)\MultiTarget\DefinedConstants.props" />
28-
<Import Project="$(ToolingDirectory)\MultiTarget\GlobalUsings.props" />
25+
<!-- Global usings for WinUI XAML namespaces -->
26+
<ItemGroup>
27+
<Using Include="Microsoft.UI.Xaml" />
28+
<Using Include="Microsoft.UI.Xaml.Controls" />
29+
<Using Include="Microsoft.UI.Xaml.Controls.Primitives" />
30+
<Using Include="Microsoft.UI.Xaml.Data" />
31+
<Using Include="Microsoft.UI.Xaml.Input" />
32+
<Using Include="Microsoft.UI.Xaml.Markup" />
33+
<Using Include="Microsoft.UI.Xaml.Media" />
34+
<Using Include="Microsoft.UI.Xaml.Media.Animation" />
35+
<Using Include="Microsoft.UI.Xaml.Navigation" />
36+
<Using Include="Microsoft.UI.Xaml.Automation" />
37+
<Using Include="Microsoft.UI.Xaml.Automation.Peers" />
38+
<Using Include="Windows.Foundation" />
39+
<Using Include="Windows.Foundation.Collections" />
40+
<Using Include="System.Runtime.InteropServices.WindowsRuntime" />
41+
<Using Include="Microsoft.UI.Xaml.Controls" Alias="MUXC" />
42+
</ItemGroup>
2943

3044
<!-- Direct project references for single component -->
3145
<ItemGroup>
3246
<ProjectReference Include="..\..\src\*.csproj" />
3347
<ProjectReference Include="..\..\samples\*.csproj" />
3448
</ItemGroup>
3549

50+
<!-- For Uno TFMs, force project references to resolve to net9.0 (not windows-specific) -->
51+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != ''">
52+
<ProjectReference Update="..\..\src\*.csproj" SetTargetFramework="TargetFramework=net9.0" />
53+
<ProjectReference Update="..\..\samples\*.csproj" SetTargetFramework="TargetFramework=net9.0" />
54+
</ItemGroup>
55+
3656
<!-- Shared app code -->
3757
<Import Project="$(ToolingDirectory)\CommunityToolkit.App.Shared\CommunityToolkit.App.Shared.projitems" Label="Shared" />
3858
<Import Project="$(ToolingDirectory)\ProjectHeads\Targets\AddMultiTargetCompatibleSampleDocs.targets" />
@@ -64,7 +84,6 @@
6484
<!-- Uno app dependencies -->
6585
<ItemGroup>
6686
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Interactivity.WinUI" Version="3.0.3" />
67-
<PackageReference Include="Uno.WinUI.Lottie" Version="6.4.242" />
6887
</ItemGroup>
6988

7089
<!-- Sample doc content inclusion (single component) -->

0 commit comments

Comments
 (0)