1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Effect/brush dialogs - Fixed window not closing on RequestClose();

This commit is contained in:
SpoinkyNL 2020-09-04 16:28:49 +02:00
parent 18225ca6fa
commit 76dcbaf6d7
3 changed files with 24 additions and 7 deletions

View File

@ -1,4 +1,5 @@
using Artemis.Core.LayerBrushes;
using System;
using Artemis.Core.LayerBrushes;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor
@ -7,7 +8,14 @@ namespace Artemis.UI.Screens.ProfileEditor
{
public LayerBrushSettingsWindowViewModel(BrushConfigurationViewModel configurationViewModel)
{
ActiveItem = configurationViewModel;
ActiveItem = configurationViewModel ?? throw new ArgumentNullException(nameof(configurationViewModel));
ActiveItem.Closed += ActiveItemOnClosed;
}
private void ActiveItemOnClosed(object sender, CloseEventArgs e)
{
ActiveItem.Closed -= ActiveItemOnClosed;
RequestClose();
}
}
}

View File

@ -1,4 +1,5 @@
using Artemis.Core.LayerEffects;
using System;
using Artemis.Core.LayerEffects;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor
@ -7,7 +8,14 @@ namespace Artemis.UI.Screens.ProfileEditor
{
public LayerEffectSettingsWindowViewModel(EffectConfigurationViewModel configurationViewModel)
{
ActiveItem = configurationViewModel;
ActiveItem = configurationViewModel ?? throw new ArgumentNullException(nameof(configurationViewModel));
ActiveItem.Closed += ActiveItemOnClosed;
}
private void ActiveItemOnClosed(object sender, CloseEventArgs e)
{
ActiveItem.Closed -= ActiveItemOnClosed;
RequestClose();
}
}
}

View File

@ -1,4 +1,5 @@
using Artemis.Core;
using System;
using Artemis.Core;
using MaterialDesignThemes.Wpf;
using Stylet;
@ -9,14 +10,14 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
public PluginSettingsWindowViewModel(PluginConfigurationViewModel configurationViewModel, PackIconKind icon)
{
Icon = icon;
ActiveItem = configurationViewModel;
ActiveItem = configurationViewModel ?? throw new ArgumentNullException(nameof(configurationViewModel));
ActiveItem.Closed += ActiveItemOnClosed;
}
public PackIconKind Icon { get; }
private void ActiveItemOnClosed(object? sender, CloseEventArgs e)
private void ActiveItemOnClosed(object sender, CloseEventArgs e)
{
ActiveItem.Closed -= ActiveItemOnClosed;
RequestClose();