Editor - Don't call ApplyUpdateValue if nothing changed

Draggable number box - Fix values resetting to 1
This commit is contained in:
Robert committed 2022-07-17 12:10:58 +02:00
1 parent d114c37439
commit bd26f447c6
3 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ namespace Artemis.Core
#region Methods
/// <summary>
/// Checks if the property already matches the desirec value or needs to be updated.
/// Checks if the property already matches the desired value or needs to be updated.
/// </summary>
/// <typeparam name="T">Type of the property.</typeparam>
/// <param name="storage">Reference to the backing-filed.</param>
@@ -24,12 +24,12 @@ public class DraggableNumberBox : UserControl
/// <summary>
/// Defines the <see cref="Minimum" /> property.
/// </summary>
public static readonly StyledProperty<double> MinimumProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Minimum), double.MinValue);
public static readonly StyledProperty<double> MinimumProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Minimum));
/// <summary>
/// Defines the <see cref="Maximum" /> property.
/// </summary>
public static readonly StyledProperty<double> MaximumProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Maximum), double.MaxValue);
public static readonly StyledProperty<double> MaximumProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Maximum));
/// <summary>
/// Defines the <see cref="LargeChange" /> property.
@@ -95,6 +95,9 @@ public abstract class PropertyInputViewModel<T> : PropertyInputViewModel
get => _inputValue;
set
{
if (Equals(_inputValue, value))
return;
this.RaiseAndSetIfChanged(ref _inputValue, value);
ApplyInputValue();
}