Skip to content

Commit 2423e55

Browse files
Remove unused code from ResourceDictionary (#21486)
1 parent f266adf commit 2423e55

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/Controls/src/Core/ResourceDictionary.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,8 @@ public Uri Source
4444
public void SetAndCreateSource<T>(Uri value)
4545
where T : ResourceDictionary, new()
4646
{
47-
_source = value;
48-
_mergedInstance = s_instances.GetValue(typeof(T), static _ => new T());
49-
OnValuesChanged(_mergedInstance.ToArray());
50-
}
51-
52-
internal void SetAndLoadSource(Uri value, string resourcePath, Assembly assembly, global::System.Xml.IXmlLineInfo lineInfo)
53-
{
54-
_source = value;
55-
56-
//this will return a type if the RD as an x:Class element, and codebehind
57-
var type = XamlResourceIdAttribute.GetTypeForPath(assembly, resourcePath);
58-
if (type != null)
59-
{
60-
_mergedInstance = s_instances.GetValue(type, _ => (ResourceDictionary)Activator.CreateInstance(type));
61-
OnValuesChanged(_mergedInstance.ToArray());
62-
}
47+
var instance = s_instances.GetValue(typeof(T), static _ => new T());
48+
SetSource(value, instance);
6349
}
6450

6551
internal static ResourceDictionary GetOrCreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type)

0 commit comments

Comments
 (0)