diff --git a/demo/Ursa.Demo/Pages/RangeSliderDemo.axaml b/demo/Ursa.Demo/Pages/RangeSliderDemo.axaml
index d39cdad..5a0576c 100644
--- a/demo/Ursa.Demo/Pages/RangeSliderDemo.axaml
+++ b/demo/Ursa.Demo/Pages/RangeSliderDemo.axaml
@@ -6,7 +6,16 @@
mc:Ignorable="d" d:DesignWidth="800"
d:DesignHeight="450"
x:Class="Ursa.Demo.Pages.RangeSliderDemo">
+
+
+
-
+
+
+
+
+
diff --git a/src/Ursa.Themes.Semi/Controls/RangeSlider.axaml b/src/Ursa.Themes.Semi/Controls/RangeSlider.axaml
index ac6f378..f71b008 100644
--- a/src/Ursa.Themes.Semi/Controls/RangeSlider.axaml
+++ b/src/Ursa.Themes.Semi/Controls/RangeSlider.axaml
@@ -5,7 +5,11 @@
-
+
diff --git a/src/Ursa/Controls/RangeSlider/RangeSlider.cs b/src/Ursa/Controls/RangeSlider/RangeSlider.cs
index 1081737..d989c4f 100644
--- a/src/Ursa/Controls/RangeSlider/RangeSlider.cs
+++ b/src/Ursa/Controls/RangeSlider/RangeSlider.cs
@@ -1,3 +1,4 @@
+using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Metadata;
using Avalonia.Controls.Primitives;
@@ -12,4 +13,41 @@ public class RangeSlider: TemplatedControl
public const string PART_DecreaseButton = "PART_DecreaseButton";
public const string PART_IncreaseButton = "PART_IncreaseButton";
public const string PART_Track = "PART_Track";
+
+ public static readonly StyledProperty MinimumProperty = RangeTrack.MinimumProperty.AddOwner();
+ public double Minimum
+ {
+ get => GetValue(MinimumProperty);
+ set => SetValue(MinimumProperty, value);
+ }
+
+ public static readonly StyledProperty MaximumProperty = RangeTrack.MaximumProperty.AddOwner();
+ public double Maximum
+ {
+ get => GetValue(MaximumProperty);
+ set => SetValue(MaximumProperty, value);
+ }
+
+ public static readonly StyledProperty LowerValueProperty = RangeTrack.LowerValueProperty.AddOwner();
+ public double LowerValue
+ {
+ get => GetValue(LowerValueProperty);
+ set => SetValue(LowerValueProperty, value);
+ }
+
+ public static readonly StyledProperty UpperValueProperty = RangeTrack.UpperValueProperty.AddOwner();
+ public double UpperValue
+ {
+ get => GetValue(UpperValueProperty);
+ set => SetValue(UpperValueProperty, value);
+ }
+
+ static RangeSlider()
+ {
+ MinimumProperty.OverrideDefaultValue(0);
+ MaximumProperty.OverrideDefaultValue(100);
+ LowerValueProperty.OverrideDefaultValue(0);
+ UpperValueProperty.OverrideDefaultValue(100);
+ }
+
}
\ No newline at end of file
diff --git a/src/Ursa/Controls/RangeSlider/RangeTrack.cs b/src/Ursa/Controls/RangeSlider/RangeTrack.cs
index 8fe1773..c37afe1 100644
--- a/src/Ursa/Controls/RangeSlider/RangeTrack.cs
+++ b/src/Ursa/Controls/RangeSlider/RangeTrack.cs
@@ -3,6 +3,7 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Metadata;
using Avalonia.Controls.Primitives;
+using Avalonia.Data;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Layout;
@@ -23,7 +24,7 @@ public class RangeTrack: Control
private Vector _lastDrag;
public static readonly StyledProperty MinimumProperty = AvaloniaProperty.Register(
- nameof(Minimum), coerce: CoerceMinimum);
+ nameof(Minimum), coerce: CoerceMinimum, defaultBindingMode:BindingMode.TwoWay);
public double Minimum
{
@@ -32,7 +33,7 @@ public class RangeTrack: Control
}
public static readonly StyledProperty MaximumProperty = AvaloniaProperty.Register(
- nameof(Maximum), coerce: CoerceMaximum);
+ nameof(Maximum), coerce: CoerceMaximum, defaultBindingMode: BindingMode.TwoWay);
public double Maximum
{
@@ -41,7 +42,7 @@ public class RangeTrack: Control
}
public static readonly StyledProperty LowerValueProperty = AvaloniaProperty.Register(
- nameof(LowerValue), coerce: CoerceLowerValue);
+ nameof(LowerValue), coerce: CoerceLowerValue, defaultBindingMode: BindingMode.TwoWay);
public double LowerValue
{
@@ -50,7 +51,7 @@ public class RangeTrack: Control
}
public static readonly StyledProperty UpperValueProperty = AvaloniaProperty.Register(
- nameof(UpperValue), coerce: CoerceUpperValue);
+ nameof(UpperValue), coerce: CoerceUpperValue, defaultBindingMode: BindingMode.TwoWay);
public double UpperValue
{