mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
UI - Started work on the gradient picker service now that my POC works
This commit is contained in:
1 parent
3c75e1d134
commit
19eb9c3275
4 files changed
+47
-4
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -6,6 +7,7 @@ using System.Windows.Input;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.UI.Shared.Annotations;
|
||||
using Artemis.UI.Shared.Screens.GradientEditor;
|
||||
using Artemis.UI.Shared.Services.Interfaces;
|
||||
|
||||
namespace Artemis.UI.Shared
|
||||
{
|
||||
@@ -14,6 +16,20 @@ namespace Artemis.UI.Shared
|
||||
/// </summary>
|
||||
public partial class GradientPicker : UserControl, INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// Used by the gradient picker to load saved gradients, do not touch or it'll just throw an exception
|
||||
/// </summary>
|
||||
public static IGradientPickerService GradientPickerService
|
||||
{
|
||||
private get => _gradientPickerService;
|
||||
set
|
||||
{
|
||||
if (_gradientPickerService != null)
|
||||
throw new AccessViolationException("This is not for you to touch");
|
||||
_gradientPickerService = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ColorGradientProperty = DependencyProperty.Register(nameof(ColorGradient), typeof(ColorGradient), typeof(GradientPicker),
|
||||
new FrameworkPropertyMetadata(default(ColorGradient), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, ColorGradientPropertyChangedCallback));
|
||||
|
||||
@@ -24,6 +40,8 @@ namespace Artemis.UI.Shared
|
||||
typeof(RoutedPropertyChangedEventHandler<ColorGradient>),
|
||||
typeof(GradientPicker));
|
||||
|
||||
private static IGradientPickerService _gradientPickerService;
|
||||
|
||||
private bool _inCallback;
|
||||
|
||||
public GradientPicker()
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using Artemis.UI.Shared.Services.Interfaces;
|
||||
|
||||
namespace Artemis.UI.Shared.Services
|
||||
{
|
||||
public class GradientPickerService : IGradientPickerService
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Artemis.UI.Shared.Services.Interfaces
|
||||
{
|
||||
public interface IGradientPickerService : IArtemisSharedUIService
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user