Skip to content

Conversation

@StephaneDelcroix
Copy link
Contributor

Runtime XAML and XamlC inflators ignore the required fields and props. XSG can do it in soem cases but fails for complex, or long references. Replace the compiler check (ignored) by a runtime check

@StephaneDelcroix StephaneDelcroix requested a review from a team as a code owner September 11, 2025 06:35
Copilot AI review requested due to automatic review settings September 11, 2025 06:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a compatibility issue with the required keyword in XAML controls within .NET MAUI templates. The runtime XAML and XamlC systems ignore required fields and properties, making the compiler check ineffective. The change replaces compile-time required validation with runtime null checks.

  • Removes required modifiers from DataTemplate properties in ChipDataTemplateSelector
  • Adds runtime null validation with descriptive error messages when templates are accessed

Runtime XAML and XamlC inflators ignore the required fields and props.
XSG can do it in soem cases but fails for complex, or long references.
Replace the compiler check (ignored) by a runtime check
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@jfversluis
Copy link
Member

We need to also update this in the maui-samples repo

@StephaneDelcroix StephaneDelcroix added this to the .NET 10.0-rc2 milestone Sep 15, 2025
@StephaneDelcroix StephaneDelcroix merged commit 6b52bca into net10.0 Sep 16, 2025
19 checks passed
@StephaneDelcroix StephaneDelcroix deleted the dev/stdelc/template_required branch September 16, 2025 09:21
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants