From c0e2d8e579d367550ee55792bc3f24b8bba4a99e Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 12 Jun 2022 16:57:39 +0200 Subject: [PATCH] Draggable numberbox - Added and use in editor --- src/.idea/.idea.Artemis/.idea/avalonia.xml | 9 + .../Profile/LayerTransformProperties.cs | 4 +- .../Controls/DraggableNumberBox.axaml | 40 ++++ .../Controls/DraggableNumberBox.axaml.cs | 179 ++++++++++++++++++ src/Artemis.UI.Shared/Styles/Condensed.axaml | 21 +- .../FloatPropertyInputView.axaml | 16 +- .../FloatPropertyInputView.axaml.cs | 14 +- .../FloatPropertyInputViewModel.cs | 18 +- .../PropertyInput/IntPropertyInputView.axaml | 26 ++- .../IntPropertyInputView.axaml.cs | 16 +- .../IntPropertyInputViewModel.cs | 18 +- .../SKPointPropertyInputView.axaml | 44 +++-- .../SKPointPropertyInputView.axaml.cs | 16 +- .../SKSizePropertyInputView.axaml | 42 ++-- .../SKSizePropertyInputView.axaml.cs | 18 +- .../Screens/Workshop/WorkshopView.axaml | 5 + .../Screens/Workshop/WorkshopViewModel.cs | 7 + 17 files changed, 395 insertions(+), 98 deletions(-) create mode 100644 src/Artemis.UI.Shared/Controls/DraggableNumberBox.axaml create mode 100644 src/Artemis.UI.Shared/Controls/DraggableNumberBox.axaml.cs diff --git a/src/.idea/.idea.Artemis/.idea/avalonia.xml b/src/.idea/.idea.Artemis/.idea/avalonia.xml index 598f128b3..d598a0111 100644 --- a/src/.idea/.idea.Artemis/.idea/avalonia.xml +++ b/src/.idea/.idea.Artemis/.idea/avalonia.xml @@ -15,13 +15,22 @@ + + + + + + + + + diff --git a/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs b/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs index 2b2ab624b..518df4953 100644 --- a/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs +++ b/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs @@ -12,13 +12,13 @@ namespace Artemis.Core /// /// The point at which the shape is attached to its position /// - [PropertyDescription(Description = "The point at which the shape is attached to its position", InputAffix = "%")] + [PropertyDescription(Description = "The point at which the shape is attached to its position", InputAffix = "%", InputStepSize = 0.001f)] public SKPointLayerProperty AnchorPoint { get; set; } /// /// The position of the shape /// - [PropertyDescription(Description = "The position of the shape", InputAffix = "%")] + [PropertyDescription(Description = "The position of the shape", InputAffix = "%", InputStepSize = 0.001f)] public SKPointLayerProperty Position { get; set; } /// diff --git a/src/Artemis.UI.Shared/Controls/DraggableNumberBox.axaml b/src/Artemis.UI.Shared/Controls/DraggableNumberBox.axaml new file mode 100644 index 000000000..23dc24c10 --- /dev/null +++ b/src/Artemis.UI.Shared/Controls/DraggableNumberBox.axaml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI.Shared/Controls/DraggableNumberBox.axaml.cs b/src/Artemis.UI.Shared/Controls/DraggableNumberBox.axaml.cs new file mode 100644 index 000000000..ad0d00513 --- /dev/null +++ b/src/Artemis.UI.Shared/Controls/DraggableNumberBox.axaml.cs @@ -0,0 +1,179 @@ +using System; +using System.Diagnostics; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Data; +using Avalonia.Input; +using Avalonia.Interactivity; +using Avalonia.Markup.Xaml; +using Avalonia.VisualTree; +using FluentAvalonia.Core; +using FluentAvalonia.UI.Controls; + +namespace Artemis.UI.Shared.Controls; + +public partial class DraggableNumberBox : UserControl +{ + /// + /// Gets or sets the value of the number box. + /// + public static readonly StyledProperty ValueProperty = AvaloniaProperty.Register(nameof(Value), defaultBindingMode: BindingMode.TwoWay); + + /// + /// Gets or sets the value of the number box. + /// + public double Value + { + get => GetValue(ValueProperty); + set => SetValue(ValueProperty, value); + } + + /// + /// Gets or sets the minimum of the number box. + /// + public static readonly StyledProperty MinimumProperty = AvaloniaProperty.Register(nameof(Minimum), double.MinValue); + + /// + /// Gets or sets the minimum of the number box. + /// + public double Minimum + { + get => GetValue(MinimumProperty); + set => SetValue(MinimumProperty, value); + } + + /// + /// Gets or sets the maximum of the number box. + /// + public static readonly StyledProperty MaximumProperty = AvaloniaProperty.Register(nameof(Maximum), double.MaxValue); + + /// + /// Gets or sets the maximum of the number box. + /// + public double Maximum + { + get => GetValue(MaximumProperty); + set => SetValue(MaximumProperty, value); + } + + public static readonly StyledProperty LargeChangeProperty = AvaloniaProperty.Register(nameof(LargeChange)); + + public double LargeChange + { + get => GetValue(LargeChangeProperty); + set => SetValue(LargeChangeProperty, value); + } + + public static readonly StyledProperty SmallChangeProperty = AvaloniaProperty.Register(nameof(SmallChange)); + + public double SmallChange + { + get => GetValue(SmallChangeProperty); + set => SetValue(SmallChangeProperty, value); + } + + public static readonly StyledProperty SimpleNumberFormatProperty = AvaloniaProperty.Register(nameof(SimpleNumberFormat)); + + public string SimpleNumberFormat + { + get => GetValue(SimpleNumberFormatProperty); + set => SetValue(SimpleNumberFormatProperty, value); + } + + public static readonly StyledProperty PrefixProperty = AvaloniaProperty.Register(nameof(Prefix)); + + public string Prefix + { + get => GetValue(PrefixProperty); + set => SetValue(PrefixProperty, value); + } + + public static readonly StyledProperty SuffixProperty = AvaloniaProperty.Register(nameof(Suffix)); + + public string Suffix + { + get => GetValue(SuffixProperty); + set => SetValue(SuffixProperty, value); + } + + public event TypedEventHandler? DragStarted; + public event TypedEventHandler? DragFinished; + + private readonly NumberBox _numberBox; + private TextBox? _inputTextBox; + private bool _moved; + private double _lastX; + private double _startX; + + public DraggableNumberBox() + { + InitializeComponent(); + _numberBox = this.Get("NumberBox"); + + PointerPressed += OnPointerPressed; + PointerMoved += OnPointerMoved; + PointerReleased += OnPointerReleased; + + AddHandler(KeyUpEvent, HandleKeyUp, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true); + } + + private void HandleKeyUp(object? sender, KeyEventArgs e) + { + if (e.Key == Key.Enter || e.Key == Key.Escape) + Parent?.Focus(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + + private void OnPointerPressed(object? sender, PointerPressedEventArgs e) + { + PointerPoint point = e.GetCurrentPoint(this); + _inputTextBox = _numberBox.FindDescendantOfType(); + _moved = false; + _startX = point.Position.X; + e.Handled = true; + } + + private void OnPointerMoved(object? sender, PointerEventArgs e) + { + PointerPoint point = e.GetCurrentPoint(this); + if (!_moved && Math.Abs(point.Position.X - _startX) < 2 || !point.Properties.IsLeftButtonPressed || _inputTextBox == null || _inputTextBox.IsFocused) + { + _lastX = point.Position.X; + return; + } + + if (!_moved) + { + // Let our parent take focus, it would make more sense to take focus ourselves but that hides the collider + Parent?.Focus(); + _moved = true; + e.Pointer.Capture(this); + DragStarted?.Invoke(this, EventArgs.Empty); + } + + double smallChange = SmallChange != 0 ? SmallChange : 0.1; + double largeChange = LargeChange != 0 ? LargeChange : smallChange * 10; + double changeMultiplier = e.KeyModifiers.HasFlag(KeyModifiers.Shift) ? smallChange : largeChange; + + Value += (point.Position.X - _lastX) * changeMultiplier; + _lastX = point.Position.X; + e.Handled = true; + } + + private void OnPointerReleased(object? sender, PointerReleasedEventArgs e) + { + if (!_moved) + _inputTextBox?.Focus(); + else + { + _moved = false; + DragFinished?.Invoke(this, EventArgs.Empty); + } + + e.Handled = true; + } +} \ No newline at end of file diff --git a/src/Artemis.UI.Shared/Styles/Condensed.axaml b/src/Artemis.UI.Shared/Styles/Condensed.axaml index 287589530..34665c6cc 100644 --- a/src/Artemis.UI.Shared/Styles/Condensed.axaml +++ b/src/Artemis.UI.Shared/Styles/Condensed.axaml @@ -3,7 +3,8 @@ xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.GradientPicker" xmlns:dataModelPicker="clr-namespace:Artemis.UI.Shared.DataModelPicker" - xmlns:controls1="clr-namespace:Artemis.UI.Shared"> + xmlns:controls1="clr-namespace:Artemis.UI.Shared" + xmlns:controls2="clr-namespace:Artemis.UI.Shared.Controls"> @@ -15,7 +16,9 @@ - + + + Bluasdadseheh @@ -42,25 +45,31 @@ + + diff --git a/src/Artemis.UI/DefaultTypes/PropertyInput/FloatPropertyInputView.axaml b/src/Artemis.UI/DefaultTypes/PropertyInput/FloatPropertyInputView.axaml index c514b9650..d58bce685 100644 --- a/src/Artemis.UI/DefaultTypes/PropertyInput/FloatPropertyInputView.axaml +++ b/src/Artemis.UI/DefaultTypes/PropertyInput/FloatPropertyInputView.axaml @@ -2,22 +2,24 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" - xmlns:shared="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared" xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput" + xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Artemis.UI.DefaultTypes.PropertyInput.FloatPropertyInputView" x:DataType="propertyInput:FloatPropertyInputViewModel"> - + DragStarted="DraggableNumberBox_OnDragStarted" + DragFinished="DraggableNumberBox_OnDragFinished"/> \ No newline at end of file diff --git a/src/Artemis.UI/DefaultTypes/PropertyInput/FloatPropertyInputView.axaml.cs b/src/Artemis.UI/DefaultTypes/PropertyInput/FloatPropertyInputView.axaml.cs index 8a219fb5d..631a05329 100644 --- a/src/Artemis.UI/DefaultTypes/PropertyInput/FloatPropertyInputView.axaml.cs +++ b/src/Artemis.UI/DefaultTypes/PropertyInput/FloatPropertyInputView.axaml.cs @@ -1,4 +1,5 @@ -using Avalonia.Input; +using System; +using Artemis.UI.Shared.Controls; using Avalonia.Markup.Xaml; using Avalonia.ReactiveUI; @@ -9,7 +10,6 @@ public class FloatPropertyInputView : ReactiveUserControl : base(layerProperty, profileEditorService, propertyInputService) { if (LayerProperty.PropertyDescription.MinInputValue.IsNumber()) - this.ValidationRule(vm => vm.InputValue, i => i >= Convert.ToSingle(LayerProperty.PropertyDescription.MinInputValue), - $"Value must be equal to or greater than {LayerProperty.PropertyDescription.MinInputValue}."); + { + float minInputValue = Convert.ToSingle(LayerProperty.PropertyDescription.MinInputValue); + this.ValidationRule(vm => vm.InputValue, i => i >= minInputValue, $"Value must be equal to or greater than {LayerProperty.PropertyDescription.MinInputValue}."); + MinInputValue = minInputValue; + } + if (LayerProperty.PropertyDescription.MaxInputValue.IsNumber()) - this.ValidationRule(vm => vm.InputValue, i => i <= Convert.ToSingle(LayerProperty.PropertyDescription.MaxInputValue), - $"Value must be smaller than {LayerProperty.PropertyDescription.MaxInputValue}."); + { + float maxInputValue = Convert.ToSingle(LayerProperty.PropertyDescription.MaxInputValue); + this.ValidationRule(vm => vm.InputValue, i => i <= maxInputValue, $"Value must be smaller than {LayerProperty.PropertyDescription.MaxInputValue}."); + MaxInputValue = maxInputValue; + } } + + public float MinInputValue { get; } = float.MinValue; + public float MaxInputValue { get; } = float.MaxValue; } \ No newline at end of file diff --git a/src/Artemis.UI/DefaultTypes/PropertyInput/IntPropertyInputView.axaml b/src/Artemis.UI/DefaultTypes/PropertyInput/IntPropertyInputView.axaml index 00d401b4c..089870508 100644 --- a/src/Artemis.UI/DefaultTypes/PropertyInput/IntPropertyInputView.axaml +++ b/src/Artemis.UI/DefaultTypes/PropertyInput/IntPropertyInputView.axaml @@ -2,18 +2,24 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" - xmlns:shared="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared" xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput" + xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Artemis.UI.DefaultTypes.PropertyInput.IntPropertyInputView" x:DataType="propertyInput:IntPropertyInputViewModel"> - + + + + \ No newline at end of file diff --git a/src/Artemis.UI/DefaultTypes/PropertyInput/IntPropertyInputView.axaml.cs b/src/Artemis.UI/DefaultTypes/PropertyInput/IntPropertyInputView.axaml.cs index e58c32f71..605c35cf9 100644 --- a/src/Artemis.UI/DefaultTypes/PropertyInput/IntPropertyInputView.axaml.cs +++ b/src/Artemis.UI/DefaultTypes/PropertyInput/IntPropertyInputView.axaml.cs @@ -1,4 +1,5 @@ -using Avalonia.Input; +using System; +using Artemis.UI.Shared.Controls; using Avalonia.Markup.Xaml; using Avalonia.ReactiveUI; @@ -9,17 +10,20 @@ public class IntPropertyInputView : ReactiveUserControl : base(layerProperty, profileEditorService, propertyInputService) { if (LayerProperty.PropertyDescription.MinInputValue.IsNumber()) - this.ValidationRule(vm => vm.InputValue, i => i >= Convert.ToInt32(LayerProperty.PropertyDescription.MinInputValue), - $"Value must be equal to or greater than {LayerProperty.PropertyDescription.MinInputValue}."); + { + int minInputValue = Convert.ToInt32(LayerProperty.PropertyDescription.MinInputValue); + this.ValidationRule(vm => vm.InputValue, i => i >= minInputValue, $"Value must be equal to or greater than {LayerProperty.PropertyDescription.MinInputValue}."); + MinInputValue = minInputValue; + } + if (LayerProperty.PropertyDescription.MaxInputValue.IsNumber()) - this.ValidationRule(vm => vm.InputValue, i => i < Convert.ToInt32(LayerProperty.PropertyDescription.MaxInputValue), - $"Value must be smaller than {LayerProperty.PropertyDescription.MaxInputValue}."); + { + int maxInputValue = Convert.ToInt32(LayerProperty.PropertyDescription.MaxInputValue); + this.ValidationRule(vm => vm.InputValue, i => i < maxInputValue, $"Value must be smaller than {LayerProperty.PropertyDescription.MaxInputValue}."); + MaxInputValue = maxInputValue; + } } + + public int MinInputValue { get; } = int.MinValue; + public int MaxInputValue { get; } = int.MaxValue; } \ No newline at end of file diff --git a/src/Artemis.UI/DefaultTypes/PropertyInput/SKPointPropertyInputView.axaml b/src/Artemis.UI/DefaultTypes/PropertyInput/SKPointPropertyInputView.axaml index 688bf503a..21ac7f4b7 100644 --- a/src/Artemis.UI/DefaultTypes/PropertyInput/SKPointPropertyInputView.axaml +++ b/src/Artemis.UI/DefaultTypes/PropertyInput/SKPointPropertyInputView.axaml @@ -2,31 +2,35 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" - xmlns:attachedProperties="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared" xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput" + xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Artemis.UI.DefaultTypes.PropertyInput.SKPointPropertyInputView" x:DataType="propertyInput:SKPointPropertyInputViewModel"> + - + , - + \ No newline at end of file diff --git a/src/Artemis.UI/DefaultTypes/PropertyInput/SKPointPropertyInputView.axaml.cs b/src/Artemis.UI/DefaultTypes/PropertyInput/SKPointPropertyInputView.axaml.cs index 53b09208c..f3437db53 100644 --- a/src/Artemis.UI/DefaultTypes/PropertyInput/SKPointPropertyInputView.axaml.cs +++ b/src/Artemis.UI/DefaultTypes/PropertyInput/SKPointPropertyInputView.axaml.cs @@ -1,6 +1,5 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Input; +using System; +using Artemis.UI.Shared.Controls; using Avalonia.Markup.Xaml; using Avalonia.ReactiveUI; @@ -11,7 +10,6 @@ namespace Artemis.UI.DefaultTypes.PropertyInput public SKPointPropertyInputView() { InitializeComponent(); - AddHandler(KeyUpEvent, OnRoutedKeyUp, handledEventsToo: true); } private void InitializeComponent() @@ -19,10 +17,14 @@ namespace Artemis.UI.DefaultTypes.PropertyInput AvaloniaXamlLoader.Load(this); } - private void OnRoutedKeyUp(object? sender, KeyEventArgs e) + private void DraggableNumberBox_OnDragStarted(DraggableNumberBox sender, EventArgs args) { - if (e.Key == Key.Enter || e.Key == Key.Escape) - FocusManager.Instance!.Focus(null); + ViewModel?.StartPreview(); + } + + private void DraggableNumberBox_OnDragFinished(DraggableNumberBox sender, EventArgs args) + { + ViewModel?.ApplyPreview(); } } } diff --git a/src/Artemis.UI/DefaultTypes/PropertyInput/SKSizePropertyInputView.axaml b/src/Artemis.UI/DefaultTypes/PropertyInput/SKSizePropertyInputView.axaml index edd44710a..af00074a6 100644 --- a/src/Artemis.UI/DefaultTypes/PropertyInput/SKSizePropertyInputView.axaml +++ b/src/Artemis.UI/DefaultTypes/PropertyInput/SKSizePropertyInputView.axaml @@ -2,30 +2,34 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" - xmlns:attachedProperties="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared" xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput" + xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Artemis.UI.DefaultTypes.PropertyInput.SKSizePropertyInputView" x:DataType="propertyInput:SKSizePropertyInputViewModel"> - + , - + diff --git a/src/Artemis.UI/DefaultTypes/PropertyInput/SKSizePropertyInputView.axaml.cs b/src/Artemis.UI/DefaultTypes/PropertyInput/SKSizePropertyInputView.axaml.cs index 81fabfb40..4aefc9469 100644 --- a/src/Artemis.UI/DefaultTypes/PropertyInput/SKSizePropertyInputView.axaml.cs +++ b/src/Artemis.UI/DefaultTypes/PropertyInput/SKSizePropertyInputView.axaml.cs @@ -1,6 +1,5 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Input; +using System; +using Artemis.UI.Shared.Controls; using Avalonia.Markup.Xaml; using Avalonia.ReactiveUI; @@ -11,7 +10,6 @@ namespace Artemis.UI.DefaultTypes.PropertyInput public SKSizePropertyInputView() { InitializeComponent(); - AddHandler(KeyUpEvent, OnRoutedKeyUp, handledEventsToo: true); } private void InitializeComponent() @@ -19,10 +17,14 @@ namespace Artemis.UI.DefaultTypes.PropertyInput AvaloniaXamlLoader.Load(this); } - private void OnRoutedKeyUp(object? sender, KeyEventArgs e) + private void DraggableNumberBox_OnDragStarted(DraggableNumberBox sender, EventArgs args) { - if (e.Key == Key.Enter || e.Key == Key.Escape) - FocusManager.Instance!.Focus(null); + ViewModel?.StartPreview(); + } + + private void DraggableNumberBox_OnDragFinished(DraggableNumberBox sender, EventArgs args) + { + ViewModel?.ApplyPreview(); } } -} +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/WorkshopView.axaml b/src/Artemis.UI/Screens/Workshop/WorkshopView.axaml index e1bc912ad..339c7af90 100644 --- a/src/Artemis.UI/Screens/Workshop/WorkshopView.axaml +++ b/src/Artemis.UI/Screens/Workshop/WorkshopView.axaml @@ -8,6 +8,7 @@ xmlns:workshop="clr-namespace:Artemis.UI.Screens.Workshop" xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.GradientPicker;assembly=Artemis.UI.Shared" + xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignWidth="800" x:Class="Artemis.UI.Screens.Workshop.WorkshopView" x:DataType="workshop:WorkshopViewModel"> @@ -41,6 +42,10 @@ attachedProperties:TextBoxAssist.PrefixText="$" attachedProperties:TextBoxAssist.SuffixText="%"> + + + + diff --git a/src/Artemis.UI/Screens/Workshop/WorkshopViewModel.cs b/src/Artemis.UI/Screens/Workshop/WorkshopViewModel.cs index 09043c29b..32df9585c 100644 --- a/src/Artemis.UI/Screens/Workshop/WorkshopViewModel.cs +++ b/src/Artemis.UI/Screens/Workshop/WorkshopViewModel.cs @@ -25,6 +25,7 @@ public class WorkshopViewModel : MainScreenViewModel }; private StandardCursorType _selectedCursor; + private double _testValue; public WorkshopViewModel(IScreen hostScreen, INotificationService notificationService) : base(hostScreen, "workshop") { @@ -51,6 +52,12 @@ public class WorkshopViewModel : MainScreenViewModel set => RaiseAndSetIfChanged(ref _colorGradient, value); } + public double TestValue + { + get => _testValue; + set => RaiseAndSetIfChanged(ref _testValue, value); + } + public void CreateRandomGradient() { ColorGradient = ColorGradient.GetRandom(6);