Browse Source

Support ExperimentalAttribute in XAML (#20765)

pull/20773/head
Julien Lebosquain 4 weeks ago
committed by GitHub
parent
commit
6e497fbe96
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      external/XamlX
  2. 7
      src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlDiagnosticCodes.cs

2
external/XamlX

@ -1 +1 @@
Subproject commit c32d3040e536ae9768233ea5a445697632578bd0 Subproject commit 009d4815470cf4bf71d1adbb633a5d81dcb2bb52

7
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlDiagnosticCodes.cs

@ -40,9 +40,9 @@ internal static class AvaloniaXamlDiagnosticCodes
// Reserved 5000-9998 // Reserved 5000-9998
public const string Obsolete = "AVLN5001"; public const string Obsolete = "AVLN5001";
internal static string XamlXDiagnosticCodeToAvalonia(object xamlException) internal static string XamlXDiagnosticCodeToAvalonia(object codeOrException)
{ {
return xamlException switch return codeOrException switch
{ {
XamlXWellKnownDiagnosticCodes wellKnownDiagnosticCodes => wellKnownDiagnosticCodes switch XamlXWellKnownDiagnosticCodes wellKnownDiagnosticCodes => wellKnownDiagnosticCodes switch
{ {
@ -50,6 +50,9 @@ internal static class AvaloniaXamlDiagnosticCodes
_ => throw new ArgumentOutOfRangeException() _ => throw new ArgumentOutOfRangeException()
}, },
// ExperimentalAttribute reports its own code
string code => code,
XamlDataContextException => DataContextResolvingError, XamlDataContextException => DataContextResolvingError,
XamlBindingsTransformException => BindingsError, XamlBindingsTransformException => BindingsError,
XamlPropertyPathException => PropertyPathError, XamlPropertyPathException => PropertyPathError,

Loading…
Cancel
Save