mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Meta - Code cleanup
This commit is contained in:
1 parent
b2ab142dbd
commit
58a964b872
105 files changed
+3097
-2624
No files matched your search
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.Colors;
|
||||
using Artemis.UI.Shared.Annotations;
|
||||
using Artemis.UI.Shared.Services.Interfaces;
|
||||
@@ -21,9 +19,6 @@ namespace Artemis.UI.Shared.Controls
|
||||
private static IGradientPickerService _gradientPickerService;
|
||||
private bool _inCallback;
|
||||
|
||||
public event EventHandler DialogOpened;
|
||||
public event EventHandler DialogClosed;
|
||||
|
||||
public GradientPicker()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -63,12 +58,25 @@ namespace Artemis.UI.Shared.Controls
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public event EventHandler DialogOpened;
|
||||
public event EventHandler DialogClosed;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
protected virtual void OnDialogOpened()
|
||||
{
|
||||
DialogOpened?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnDialogClosed()
|
||||
{
|
||||
DialogClosed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private static void ColorGradientPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var gradientPicker = (GradientPicker) d;
|
||||
@@ -102,15 +110,5 @@ namespace Artemis.UI.Shared.Controls
|
||||
EventManager.RegisterRoutedEvent(nameof(ColorGradient), RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<ColorGradient>), typeof(GradientPicker));
|
||||
|
||||
#endregion
|
||||
|
||||
protected virtual void OnDialogOpened()
|
||||
{
|
||||
DialogOpened?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnDialogClosed()
|
||||
{
|
||||
DialogClosed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user