diff --git a/src/windows/SliderWindows/SliderView.cpp b/src/windows/SliderWindows/SliderView.cpp index cc6173aa..7b82d51f 100644 --- a/src/windows/SliderWindows/SliderView.cpp +++ b/src/windows/SliderWindows/SliderView.cpp @@ -80,7 +80,7 @@ namespace winrt::SliderWindows::implementation { } else { updatedMaxValue = true; - m_maxValue = propertyValue.AsInt64(); + m_maxValue = propertyValue.AsDouble(); } } else if (propertyName == "minimumValue") { @@ -89,16 +89,19 @@ namespace winrt::SliderWindows::implementation { } else { updatedMinValue = true; - m_minValue = propertyValue.AsInt64(); + m_minValue = propertyValue.AsDouble(); } } else if (propertyName == "step") { if (propertyValue.IsNull()) { this->ClearValue(xaml::Controls::Slider::StepFrequencyProperty()); } - else { + else if (propertyValue.AsDouble() != 0) { this->StepFrequency(propertyValue.AsDouble()); } + else { + this->StepFrequency(c_stepDefault); + } } else if (propertyName == "inverted") { if (propertyValue.IsNull()) { diff --git a/src/windows/SliderWindows/SliderView.h b/src/windows/SliderWindows/SliderView.h index 25a9c625..f9eadb6e 100644 --- a/src/windows/SliderWindows/SliderView.h +++ b/src/windows/SliderWindows/SliderView.h @@ -35,8 +35,8 @@ namespace winrt::SliderWindows::implementation { winrt::Windows::Foundation::IInspectable const& sender, xaml::Input::ManipulationCompletedRoutedEventArgs const& args); - int64_t m_maxValue, m_minValue; - double m_value; + double m_value, m_maxValue, m_minValue; + const double c_stepDefault = 0.1; }; }