Skip to content

Commit 8dfa4e2

Browse files
Copilotjfversluis
andauthored
Address PR feedback: refine XAML source generation documentation (#3079)
* Initial plan * Address PR feedback: update XAML source generation docs - Changed "preview" to "opt-in" in IMPORTANT notes - Reordered content to promote global setting first - Added fine-grained control section with clear context - Fixed markdown formatting (missing > characters in runtime-load.md) Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
1 parent e23704e commit 8dfa4e2

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

docs/xaml/fundamentals/get-started.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,28 +83,28 @@ The following example shows a <xref:Microsoft.Maui.Controls.ContentPage> contain
8383
## XAML Source Generation
8484

8585
> [!IMPORTANT]
86-
> This feature is in preview. To try it, opt-in by setting the XAML inflator in your project file as per the instructions below. Behavior and defaults may change. Please let us know your experience with this (good or bad) in the .NET MAUI repository.
86+
> This feature is opt-in. To use it, set the XAML inflator in your project file as per the instructions below. Please let us know your experience with this (good or bad) in the .NET MAUI repository.
8787
8888
You have the option as of .NET 10 to have XAML generate C# instead of IL (intermediate language) by using Roslyn source generation. This improves your ability to debug XAML by emitting the source files and setting break points in them directly, speeds up the debug performance of page rendering, and improves your app behavior consistency between debug and release build modes.
8989

90-
To enable XAML source generation for all XAML files in the project, add this to your project file.
90+
To enable XAML source generation for the whole project, add this to your project file:
9191

9292
```xml
93-
<ItemGroup>
94-
<MauiXaml Update="**/*.xaml" Inflator="SourceGen" />
95-
</ItemGroup>
93+
<PropertyGroup>
94+
<MauiXamlInflator>SourceGen</MauiXamlInflator>
95+
</PropertyGroup>
9696
```
9797

98-
Similarly, you can include or exclude certain XAML files by configuring the pattern in the `Inflator` attribute.
99-
100-
To enable XAML source generation for the whole project, you can add this.
98+
For more fine-grained control over what XAML files use XAML Source Generation, you can configure individual files or patterns:
10199

102100
```xml
103-
<PropertyGroup>
104-
<MauiXamlInflator>SourceGen</MauiXamlInflator>
105-
</PropertyGroup>
101+
<ItemGroup>
102+
<MauiXaml Update="**/*.xaml" Inflator="SourceGen" />
103+
</ItemGroup>
106104
```
107105

106+
You can include or exclude certain XAML files by configuring the pattern in the `Inflator` attribute.
107+
108108
Reference the [source generator configuration documentation](/dotnet/core/extensions/configuration-generator) for using options like `EmitCompilerGeneratedFiles`.
109109

110110
## Global XML namespace (preview)

docs/xaml/runtime-load.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ The `InitializeComponent` method calls the <xref:Microsoft.Maui.Controls.Xaml.Ex
3333
::: moniker range=">=net-maui-10.0"
3434

3535
> [!IMPORTANT]
36-
> XAML source generation in .NET MAUI for .NET 10 is a preview feature. To try it, opt-in by setting the XAML inflator to the source generation one. Behavior and APIs can change while in preview. Please let us know your experience with this (good or bad) in the .NET MAUI repository.
36+
> XAML source generation in .NET MAUI for .NET 10 is opt-in. To use it, set the XAML inflator to the source generation one. Please let us know your experience with this (good or bad) in the .NET MAUI repository.
3737
>
3838
> Example:
3939
>
4040
> To enable XAML source generation for all XAML files in the project, add this to your project file.
41-
>
41+
>
4242
> ```xml
4343
> <ItemGroup>
4444
> <MauiXaml Update="**/*.xaml" Inflator="SourceGen" />
4545
> </ItemGroup>
4646
> ```
4747
>
4848
> Similarly, you can include or exclude certain XAML files by configuring the pattern in the `Inflator` attribute.
49-
>
49+
>
5050
> To enable XAML source generation for the whole project, you can add this.
5151
>
5252
> ```xml

0 commit comments

Comments
 (0)