From 60fcfb25c997642ea44fee92c4c8abf4b8f46612 Mon Sep 17 00:00:00 2001 From: lindexi Date: Wed, 19 Jul 2023 08:59:47 +0800 Subject: [PATCH 1/2] Adding System.Windows.Media.Animation.BackEase as known type. https://github.com/dotnet/wpf/issues/6588 --- .../Windows/Markup/Baml2006/Baml2006KnownTypes.cs | 3 ++- .../Markup/Baml2006/WpfGeneratedKnownTypes.cs | 15 ++++++++++++++- .../System/Windows/Markup/KnownTypes.cs | 8 ++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/Baml2006KnownTypes.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/Baml2006KnownTypes.cs index 0ef92d493..99c38b9b8 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/Baml2006KnownTypes.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/Baml2006KnownTypes.cs @@ -45,7 +45,7 @@ internal static class KnownTypes public const Int16 XamlPointCollectionSerializer = 748; public const Int16 XamlVector3DCollectionSerializer = 752; - public const Int16 MaxKnownType = 759; + public const Int16 MaxKnownType = 760; public const Int16 MaxKnownProperty = 268; public const Int16 MinKnownProperty = -268; @@ -853,6 +853,7 @@ public static Type GetKnownType(Int16 typeId) case 757: t = () => typeof(XmlLanguageConverter); break; case 758: t = () => typeof(XmlNamespaceMapping); break; case 759: t = () => typeof(ZoomPercentageConverter); break; + case 760: t = () => typeof(System.Windows.Media.Animation.BackEase); break; default: t = () => null; break; } diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs index 0b2c324ad..5f7630600 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs @@ -11,7 +11,7 @@ namespace System.Windows.Baml2006 { partial class WpfSharedBamlSchemaContext : XamlSchemaContext { - const int KnownTypeCount = 759; + const int KnownTypeCount = 760; private WpfKnownType CreateKnownBamlType(short bamlNumber, bool isBamlType, bool useV3Rules) @@ -777,6 +777,7 @@ private WpfKnownType CreateKnownBamlType(short bamlNumber, bool isBamlType, bool case 757: return Create_BamlType_XmlLanguageConverter(isBamlType, useV3Rules); // type converter case 758: return Create_BamlType_XmlNamespaceMapping(isBamlType, useV3Rules); case 759: return Create_BamlType_ZoomPercentageConverter(isBamlType, useV3Rules); + case 760: return Create_BamlType_BackEase(isBamlType, useV3Rules); default: throw new InvalidOperationException("Invalid BAML number"); } @@ -982,6 +983,7 @@ protected WpfKnownType CreateKnownBamlType(string typeName, bool isBamlType, boo case 897706848 : return Create_BamlType_TextBlock(isBamlType, useV3Rules); case 905080928 : return Create_BamlType_FixedDocumentSequence(isBamlType, useV3Rules); case 906240700 : return Create_BamlType_UserControl(isBamlType, useV3Rules); + case 907931051 : return Create_BamlType_BackEase(isBamlType, useV3Rules); case 912040738 : return Create_BamlType_TextEffectCollection(isBamlType, useV3Rules); case 916823320 : return Create_BamlType_InputDevice(isBamlType, useV3Rules); case 921174220 : return Create_BamlType_TriggerCollection(isBamlType, useV3Rules); @@ -11530,6 +11532,17 @@ private WpfKnownType Create_BamlType_ZoomPercentageConverter(bool isBamlType, bo return bamlType; } + private WpfKnownType Create_BamlType_BackEase(bool isBamlType, bool useV3Rules) + { + var bamlType = new WpfKnownType(this, // SchemaContext + 760, "BackEase", + typeof(System.Windows.Media.Animation.BackEase), + isBamlType, useV3Rules); + bamlType.DefaultConstructor = delegate () { return new System.Windows.Media.Animation.BackEase(); }; + bamlType.Freeze(); + return bamlType; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private WpfKnownType Create_BamlType_CommandBinding(bool isBamlType, bool useV3Rules) { diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/KnownTypes.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/KnownTypes.cs index 67094eded..8439dc842 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/KnownTypes.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/KnownTypes.cs @@ -829,7 +829,8 @@ internal enum KnownElements : short XmlLanguageConverter, XmlNamespaceMapping, ZoomPercentageConverter, - MaxElement + BackEase, + MaxElement, } // This enum specifies the IDs we use for known CLR and DP Properties in BAML. @@ -1668,6 +1669,7 @@ internal static object CreateKnownElement(KnownElements knownElement) case KnownElements.XmlLanguageConverter: o = new System.Windows.Markup.XmlLanguageConverter(); break; case KnownElements.XmlNamespaceMapping: o = new System.Windows.Data.XmlNamespaceMapping(); break; case KnownElements.ZoomPercentageConverter: o = new System.Windows.Documents.ZoomPercentageConverter(); break; + case KnownElements.BackEase: o = new System.Windows.Media.Animation.BackEase(); break; } return o; } @@ -4949,7 +4951,8 @@ private Type InitializeOneType(KnownElements knownElement) case KnownElements.Typography: t = _asmFramework.GetType("System.Windows.Documents.Typography"); break; case KnownElements.Underline: t = _asmFramework.GetType("System.Windows.Documents.Underline"); break; case KnownElements.ZoomPercentageConverter: t = _asmFramework.GetType("System.Windows.Documents.ZoomPercentageConverter"); break; - case KnownElements.DynamicResourceExtension: t = _asmFramework.GetType("System.Windows.DynamicResourceExtension"); break; + case KnownElements.BackEase: t = _asmFramework.GetType("System.Windows.Media.Animation.BackEase"); break; + case KnownElements.DynamicResourceExtension: t = _asmFramework.GetType("System.Windows.DynamicResourceExtension"); break; case KnownElements.DynamicResourceExtensionConverter: t = _asmFramework.GetType("System.Windows.DynamicResourceExtensionConverter"); break; case KnownElements.SetterBase: t = _asmFramework.GetType("System.Windows.SetterBase"); break; case KnownElements.EventSetter: t = _asmFramework.GetType("System.Windows.EventSetter"); break; @@ -6297,6 +6300,7 @@ private Type InitializeOneType(KnownElements knownElement) case KnownElements.XmlLanguageConverter: t = typeof(System.Windows.Markup.XmlLanguageConverter); break; case KnownElements.XmlNamespaceMapping: t = typeof(System.Windows.Data.XmlNamespaceMapping); break; case KnownElements.ZoomPercentageConverter: t = typeof(System.Windows.Documents.ZoomPercentageConverter); break; + case KnownElements.BackEase: t = typeof(System.Windows.Media.Animation.BackEase); break; } return t; From 05474549d3a5779392525021db69eee8047d3bf1 Mon Sep 17 00:00:00 2001 From: lindexi Date: Wed, 19 Jul 2023 17:26:42 +0800 Subject: [PATCH 2/2] Add the method attribute to Create_BamlType_BackEase --- .../System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs index 5f7630600..4eac6aecc 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Baml2006/WpfGeneratedKnownTypes.cs @@ -11532,6 +11532,7 @@ private WpfKnownType Create_BamlType_ZoomPercentageConverter(bool isBamlType, bo return bamlType; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private WpfKnownType Create_BamlType_BackEase(bool isBamlType, bool useV3Rules) { var bamlType = new WpfKnownType(this, // SchemaContext