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: diff --git a/docs/xaml/class-modifiers.md b/docs/xaml/class-modifiers.md index 23219d784d..d82c2ceb5e 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 @@ -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.|