memory optimization

This commit is contained in:
NaBian committed 2021-06-10 00:40:13 +08:00
1 parent 5afb569d11
commit 1ec8cb521c
5 files changed
+92 -36

No files matched your search

@@ -79,13 +79,20 @@ namespace HandyControl.Tools
Source = new Uri($"pack://application:,,,/HandyControl;component/Themes/Skin{skin}.xaml")
};
private static ResourceDictionary HcTheme;
/// <summary>
/// get HandyControl theme
/// </summary>
/// <returns></returns>
public static ResourceDictionary GetTheme() => new Lazy<ResourceDictionary>(() => new ResourceDictionary
public static ResourceDictionary GetTheme()
{
Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
}).Value;
HcTheme ??= new ResourceDictionary
{
Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
};
return HcTheme;
}
}
}