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:
parent
18225ca6fa
commit
76dcbaf6d7
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user