You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The actual position of the upper/lower thumbs may become out of sync with the actual values, when the coercion of the bound properties takes effect during dragging operations.
To Reproduce
Consider the following dependency property:
public static readonly DependencyProperty MaxValueDisplayedProperty = DependencyProperty.Register(
"MaxValueDisplayed", typeof(double), typeof(MainWindow), new PropertyMetadata(75d, PropertyChangedCallback, CoerceValueCallback ));
private static object CoerceValueCallback(DependencyObject dependencyObject, object baseValue)
{
var value = (double) baseValue;
if (value < 50)
return 50.0;
return baseValue;
}
Steps to reproduce the behavior:
Start dragging the UpperThumb (e.g. the right thumb with initial value of 75) towards the LowerLimit (0 in our case)
As the UpperLimit reaches 50 the value is coerced to 50 (both the MaxValueDisplayed and the RangeSlider.UpperLimit show 50)
The user is however free to drag on - that is the actual thumb position becomes out of sync with the current value
Even after releasing the mouse button, the position of the thumb is out of sync
The behavior is the same regardless of whether we're dragging the whole range or just the upper tracker.
Expected behavior
The thumb position respects the coerced value at all times: similar to how the slider stops moving when reaching the same coercion limit (3rd screenshot)
Screenshots
Environment:
MahApps.Metro version [both v1.6.4 & 2.0.0-alpha0821]
OS: [Win10]
Visual Studio [2017]
.NET Framework [4.7.2]
Repo Here is the very simple example from the screenshots, with the very basic designer definition:
- Use RangeSelectionChangedEventHandler<T> and RangeSelectionChangedEventArgs<T>
- Use RoutedPropertyChangedEventHandler<T> and RoutedPropertyChangedEventArgs<T>
@lipchev This is now fixed and will be available with next v2.0 release. Thx for using the latest alpha hot stuff and reporting the issue. And thx for the sample! 👍
The actual position of the upper/lower thumbs may become out of sync with the actual values, when the coercion of the bound properties takes effect during dragging operations.
To Reproduce
Consider the following dependency property:
Steps to reproduce the behavior:
Expected behavior
The thumb position respects the coerced value at all times: similar to how the slider stops moving when reaching the same coercion limit (3rd screenshot)
Screenshots
Environment:
Repo
Here is the very simple example from the screenshots, with the very basic designer definition:
The text was updated successfully, but these errors were encountered: