From 1c2f145ae92519c5c760ff4f6461d5bb4eb5b817 Mon Sep 17 00:00:00 2001 From: David Britch Date: Thu, 19 Oct 2023 15:03:57 +0100 Subject: [PATCH 1/3] XAML class modifiers. --- docs/whats-new/dotnet-8.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/whats-new/dotnet-8.md b/docs/whats-new/dotnet-8.md index e27ace0294..3c443c3761 100644 --- a/docs/whats-new/dotnet-8.md +++ b/docs/whats-new/dotnet-8.md @@ -35,6 +35,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c - For troubleshooting purposes, a blank splash screen can be generated. For more information, see [Generate a blank splash screen](~/troubleshooting.md#generate-a-blank-splash-screen). - Resizeter checks for duplicate image filenames. For more information, see [Duplicate image filename errors](~/troubleshooting.md#duplicate-image-filename-errors). - Controls that support text input gain extension methods that support hiding and showing the soft input keyboard. For more information, see [Hide and show the soft input keyboard](~/user-interface/controls/entry.md#hide-and-show-the-soft-input-keyboard). +- The `x:ClassModifier` attribute can be specified on XAML classes, to control the access level for a generated class in an assembly. For more information, see [Class modifiers](~/xaml/class-modifiers.md). The following types or members have been deprecated: From 118347785a463d213b4c2909dd22794eb5c2b79d Mon Sep 17 00:00:00 2001 From: David Britch Date: Thu, 19 Oct 2023 15:06:38 +0100 Subject: [PATCH 2/3] Fix moniker range. --- docs/xaml/class-modifiers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/xaml/class-modifiers.md b/docs/xaml/class-modifiers.md index 23219d784d..4e4c65395e 100644 --- a/docs/xaml/class-modifiers.md +++ b/docs/xaml/class-modifiers.md @@ -2,7 +2,7 @@ title: "Class modifiers" description: "The .NET MAUI x:ClassModifier attribute specifies the access level for generated fields for named XAML elements." ms.date: 10/19/2023 -monikerRange: "=>net-maui-8.0" +monikerRange: ">=net-maui-8.0" --- # Class modifiers From 0fcd2820b1cf60396a3801155f23d82472bce9ae Mon Sep 17 00:00:00 2001 From: David Britch Date: Thu, 19 Oct 2023 15:18:06 +0100 Subject: [PATCH 3/3] Edit. --- docs/xaml/class-modifiers.md | 2 ++ docs/xaml/namespaces/index.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/xaml/class-modifiers.md b/docs/xaml/class-modifiers.md index 4e4c65395e..d82c2ceb5e 100644 --- a/docs/xaml/class-modifiers.md +++ b/docs/xaml/class-modifiers.md @@ -15,6 +15,8 @@ Valid values of the `x:ClassModifier` attribute are: - `Internal` – specifies that the generated class is accessible only within types in the same assembly. - `NotPublic` – identical to `Internal`. +The value of the `x:ClassModifier` attribute must align with the access level of the type in its code-behind file. + By default, if the value of the attribute isn't set, the generated class will be `public`. > [!NOTE] diff --git a/docs/xaml/namespaces/index.md b/docs/xaml/namespaces/index.md index 5989d36bc7..1110075d95 100644 --- a/docs/xaml/namespaces/index.md +++ b/docs/xaml/namespaces/index.md @@ -47,7 +47,7 @@ For more information about the `x:DataType` attribute, see [Compiled bindings](~ |--- |--- | |`x:Arguments`|Specifies constructor arguments for a non-default constructor, or for a factory method object declaration.| |`x:Class`|Specifies the namespace and class name for a class defined in XAML. The class name must match the class name of the code-behind file. Note that this construct can only appear in the root element of a XAML file.| -|`x:ClassModifier`|Specifies the access level for the class in the assembly.| +|`x:ClassModifier`|Specifies the access level for the generated class in the assembly.| |`x:DataType`|Specifies the type of the object that the XAML element, and it's children, will bind to.| |`x:FactoryMethod`|Specifies a factory method that can be used to initialize an object.| |`x:FieldModifier`|Specifies the access level for generated fields for named XAML elements.|