Skip to content

Commit 7699d41

Browse files
authored
docs: Adjust for CPM
1 parent 1327db2 commit 7699d41

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

doc/using-xamlmerge.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,37 @@ To limit the impact of the traversal, this task takes all resource dictionaries
1212

1313
## Using the task
1414

15-
1. In your `csproj` file, include the following block:
16-
17-
```xml
18-
<PropertyGroup>
19-
<_Uno_XamlMerge_Task_Version>1.0.0</_Uno_XamlMerge_Task_Version>
20-
</PropertyGroup>
21-
<ItemGroup>
22-
<PackageReference Include="Uno.XamlMerge.Task" Version="$(_Uno_XamlMerge_Task_Version)" />
23-
</ItemGroup>
24-
```
15+
1. Add a package reference:
16+
17+
* If your project does not use [Central Package Management](https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management#enabling-central-package-management), in your `csproj` file, include the following block:
18+
19+
```xml
20+
<PropertyGroup>
21+
<_Uno_XamlMerge_Task_Version>1.0.0</_Uno_XamlMerge_Task_Version>
22+
</PropertyGroup>
23+
<ItemGroup>
24+
<PackageReference Include="Uno.XamlMerge.Task" Version="$(_Uno_XamlMerge_Task_Version)" />
25+
</ItemGroup>
26+
```
27+
28+
* If your project is using [Central Package Management](https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management#enabling-central-package-management), add the following to your `Directory.Packages.props`:
29+
30+
```xml
31+
<PropertyGroup>
32+
<_Uno_XamlMerge_Task_Version>1.0.0</_Uno_XamlMerge_Task_Version>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<PackageVersion Include="Uno.XamlMerge.Task" Version="$(_Uno_XamlMerge_Task_Version)" />
36+
</ItemGroup>
37+
```
38+
39+
Then the following to your `.csproj`:
40+
41+
```xml
42+
<ItemGroup>
43+
<PackageVersion Include="Uno.XamlMerge.Task" Version="$(_Uno_XamlMerge_Task_Version)" />
44+
</ItemGroup>
45+
```
2546

2647
1. Specify the resource dictionaries to be merged:
2748

@@ -63,6 +84,8 @@ To limit the impact of the traversal, this task takes all resource dictionaries
6384
</ResourceDictionary>
6485
```
6586

87+
Then replace `REPLACE_ME/` with either the library name if you're adding the package to a class library, or with nothing if you're adding it to your main project (e.g. `ms-appx:///Generated/mergedpages.xaml`).
88+
6689
## Multiple generated files
6790

6891
There are scenarios where placing groups of XAML files in separate merged files are useful, particularly, when IL Linking must be used.

0 commit comments

Comments
 (0)