mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 08:56:15 +02:00
Improve plugin window performance by not constantly updating properties of UI elements
This commit is contained in:
@@ -39,7 +39,6 @@ namespace DesktopMagic
|
||||
private bool blockWindowsClosing = true;
|
||||
public static List<PluginWindow> Windows { get; } = [];
|
||||
public static List<string> WindowNames { get; } = [];
|
||||
internal static bool EditMode { get; set; } = false;
|
||||
|
||||
private DesktopMagicSettings Settings
|
||||
{
|
||||
@@ -173,7 +172,11 @@ namespace DesktopMagic
|
||||
|
||||
private void EditCheckBox_Click(object? sender, RoutedEventArgs? e)
|
||||
{
|
||||
EditMode = EditCheckBox.IsChecked == true;
|
||||
foreach (PluginWindow window in Windows)
|
||||
{
|
||||
window.SetEditMode(EditCheckBox.IsChecked == true);
|
||||
}
|
||||
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
@@ -261,6 +264,7 @@ namespace DesktopMagic
|
||||
|
||||
window.ShowInTaskbar = false;
|
||||
window.Show();
|
||||
window.SetEditMode(EditCheckBox.IsChecked == true);
|
||||
window.ContentRendered += DisplayWindow_ContentRendered;
|
||||
window.Closing += DisplayWindow_Closing;
|
||||
Windows.Add(window);
|
||||
@@ -565,7 +569,6 @@ namespace DesktopMagic
|
||||
}
|
||||
|
||||
EditCheckBox.IsChecked = false;
|
||||
EditMode = false;
|
||||
blockWindowsClosing = true;
|
||||
Windows.Clear();
|
||||
WindowNames.Clear();
|
||||
|
||||
Reference in New Issue
Block a user