diff --git a/src/Controls/src/Core/ResourceDictionary.cs b/src/Controls/src/Core/ResourceDictionary.cs index 1129caff7b6d..68303f746012 100644 --- a/src/Controls/src/Core/ResourceDictionary.cs +++ b/src/Controls/src/Core/ResourceDictionary.cs @@ -44,22 +44,8 @@ public Uri Source public void SetAndCreateSource(Uri value) where T : ResourceDictionary, new() { - _source = value; - _mergedInstance = s_instances.GetValue(typeof(T), static _ => new T()); - OnValuesChanged(_mergedInstance.ToArray()); - } - - internal void SetAndLoadSource(Uri value, string resourcePath, Assembly assembly, global::System.Xml.IXmlLineInfo lineInfo) - { - _source = value; - - //this will return a type if the RD as an x:Class element, and codebehind - var type = XamlResourceIdAttribute.GetTypeForPath(assembly, resourcePath); - if (type != null) - { - _mergedInstance = s_instances.GetValue(type, _ => (ResourceDictionary)Activator.CreateInstance(type)); - OnValuesChanged(_mergedInstance.ToArray()); - } + var instance = s_instances.GetValue(typeof(T), static _ => new T()); + SetSource(value, instance); } internal static ResourceDictionary GetOrCreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type)