Open KirillOsenkov opened 5 months ago
private static void TurnOffWpfExtensionAssemblies()
{
var windowsBase = typeof(DependencyObject).Assembly;
var presentationFramework = typeof(FrameworkElement).Assembly;
var assemblyHelper = windowsBase.GetType("MS.Internal.AssemblyHelper");
Reflector.PatchMethodToNoOp(assemblyHelper, ".cctor", isCtor: true);
Reflector.PatchMethodToNoOp(assemblyHelper, "ExtensionsForSystemDrawing");
Reflector.PatchMethodToNoOp(assemblyHelper, "ExtensionsForSystemXmlLinq");
Reflector.PatchMethodToNoOp(assemblyHelper, "ExtensionsForSystemData");
Reflector.PatchMethodToNoOp(assemblyHelper, "ExtensionsForSystemCore");
Reflector.PatchMethodToNoOp(assemblyHelper, "ExtensionsForSystemXml");
Reflector.PatchMethodToNoOp(assemblyHelper, "OnLoaded");
var dataBindEngine = presentationFramework.GetType("MS.Internal.Data.DataBindEngine");
Reflector.PatchMethodToNoOp(dataBindEngine, "RegisterForCacheChanges");
}
https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/ValueTable.cs#L39-L49