mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Fix FindResource
http://windowsasusual.blogspot.ie/2015/10/wpf-applicationcurrentfindresource-and.html
This commit is contained in:
@@ -59,16 +59,11 @@ namespace Wox.Core.Theme
|
||||
UserSettingStorage.Instance.Save();
|
||||
ResourceMerger.UpdateResource(this);
|
||||
|
||||
try
|
||||
{
|
||||
var isBlur = Application.Current.FindResource("ThemeBlurEnabled");
|
||||
if (isBlur is bool)
|
||||
{
|
||||
SetBlurForWindow(Application.Current.MainWindow, (bool)isBlur);
|
||||
}
|
||||
}
|
||||
catch (ResourceReferenceKeyNotFoundException e)
|
||||
// Exception of FindResource can't be cathed if global exception handle is set
|
||||
var isBlur = Application.Current.TryFindResource("ThemeBlurEnabled");
|
||||
if (isBlur is bool)
|
||||
{
|
||||
SetBlurForWindow(Application.Current.MainWindow, (bool)isBlur);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user