mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
[ImageResizer] Workaround for exception in wpf ui. (#30225)
* [ImageResizer] Workaround for exception in wpf ui. * Adding try catch to the other 3 places the SystemThemeWatcher is used. Rearranging code in Image Resizer, which might solve the issue.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using ManagedCommon;
|
||||
using Wpf.Ui.Controls;
|
||||
using Point = PowerAccent.Core.Point;
|
||||
using Size = PowerAccent.Core.Size;
|
||||
@@ -38,7 +39,17 @@ public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChange
|
||||
public Selector()
|
||||
{
|
||||
InitializeComponent();
|
||||
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
|
||||
|
||||
// workaround for #30177
|
||||
try
|
||||
{
|
||||
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Exception in SystemThemeWatcher.Watch, issue 30177. {ex.Message}");
|
||||
}
|
||||
|
||||
Application.Current.MainWindow.ShowActivated = false;
|
||||
Application.Current.MainWindow.Topmost = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user