Input - Polished up UI

Input - Added events to service
This commit is contained in:
SpoinkyNL committed 2020-11-23 19:41:48 +01:00
1 parent 6ee5cbd09c
commit f1f0abfec5
40 files changed
+552 -203

No files matched your search

@@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Windows.Documents;
using Artemis.Core;
using Artemis.Core.DataModelExpansions;
using Artemis.UI.Shared.Services;
@@ -22,11 +22,5 @@ namespace Artemis.UI.Shared.Screens.Dialogs
if (Session != null && !Session.IsEnded)
Session.Close(true);
}
public void Cancel()
{
if (Session != null && !Session.IsEnded)
Session.Close(false);
}
}
}
@@ -91,15 +91,14 @@ namespace Artemis.UI.Shared.Screens.GradientEditor
Session.Close(true);
}
public void Cancel()
public override void Cancel()
{
// Restore the saved state
ColorGradient.Stops.Clear();
ColorGradient.Stops.AddRange(_originalStops);
ColorGradient.OnColorValuesUpdated();
if (Session != null && !Session.IsEnded)
Session.Close(false);
base.Cancel();
}
private void UpdateColorStopViewModels(object? sender, PropertyChangedEventArgs e)
@@ -49,6 +49,15 @@ namespace Artemis.UI.Shared.Services
{
}
/// <summary>
/// If not yet closed, closes the current session passing <see langword="false" />
/// </summary>
public virtual void Cancel()
{
if (Session != null && !Session.IsEnded)
Session.Close(false);
}
internal void OnDialogOpened(object sender, DialogOpenedEventArgs e)
{
Session = e.Session;