Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XAML class modifiers #1804

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/whats-new/dotnet-8.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 3 additions & 1 deletion docs/xaml/class-modifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion docs/xaml/namespaces/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.|
Expand Down