Skip to content

Handle XamlWriter.Save failing on non-public internal types#780

Merged
SimonCropp merged 1 commit into
mainfrom
Handle-XamlWriter.Save-failing-on-non-public-internal-types
Apr 16, 2026
Merged

Handle XamlWriter.Save failing on non-public internal types#780
SimonCropp merged 1 commit into
mainfrom
Handle-XamlWriter.Save-failing-on-non-public-internal-types

Conversation

@SimonCropp
Copy link
Copy Markdown
Member

When WPF's XamlWriter.Save encounters non-public types like System.Windows.Baml2006.KeyRecord (common in .NET 11 with merged ResourceDictionaries and DataTemplates), it throws InvalidOperationException. Catch that in ToXamlString and fall back to producing only the PNG snapshot instead of crashing the test.

When WPF's XamlWriter.Save encounters non-public types like System.Windows.Baml2006.KeyRecord (common in .NET 11 with  merged ResourceDictionaries and DataTemplates), it throws InvalidOperationException. Catch that in ToXamlString and fall back to producing only the PNG snapshot instead of crashing the test.
@SimonCropp SimonCropp added this to the 4.2.1 milestone Apr 16, 2026
@SimonCropp SimonCropp merged commit 0a28ddc into main Apr 16, 2026
7 checks passed
@SimonCropp SimonCropp deleted the Handle-XamlWriter.Save-failing-on-non-public-internal-types branch April 16, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant