Draggable numberbox - Added and use in editor

This commit is contained in:
Robert committed 2022-06-12 16:57:39 +02:00
1 parent ecbc3e4f35
commit c0e2d8e579
17 files changed
+395 -98

No files matched your search

@@ -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="%">
</TextBox>
<TextBlock Classes="h4" Text="{CompiledBinding TestValue}"/>
<controls:DraggableNumberBox Value="{CompiledBinding TestValue}"/>
<controls:DraggableNumberBox Value="{CompiledBinding TestValue}" Classes="condensed"/>
<StackPanel Orientation="Horizontal" Spacing="5">
<Border Classes="card" Cursor="{CompiledBinding Cursor}">
@@ -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);