Good day,
I am using the SFRangeSlider control in a MVVM environment using Prism/Unity.
The goal is to use two RangeSliders in a ContentPage. The first control allows the user to select a single value, the second control allows the user to modify the range of values shown by the first slider by adjusting the RangeStart and RangeStop properties of the second control. Code behind updates the first control's Minimum and Maximum values with the second controls RangeStart and RangeEnd values when the DragCompleted event is triggered. A arbitrary Button control is used to make the two controls visible/invisible in the ContentPage
Scenario1 - works as expected:
The control values are initialised by the ViewModel page constructor and the RangeSliders are visible from the start. Adjusting the RangeStart and RangeEnd values in the second control changes the Minimum or Maximum values of the first control. After Intialise the first control's Value is set correctly.
Scenario2 - does not work as expected:
In this scenario the ViewModel constructor does not initialise the two control's values and the controls are not visible directly after Initialise.
The user can make the controls visible via the Button control that sets the IsVisible property in the ViewModel making the two control visible.
In this scenario the RangeStart/RangeEnd values of the second control as well as the Value of the first control seems not to be updated correctly.
The two scenarios can be replicated by setting the RSISVisible flag to either true or false in line 118 of Page1ViewModel.cs.
Question1:
Please provide some insight into why in scenario 2 the second controls RangeStart and RangeEnd values are not initialised correctly.
Question2:
Same as Q1, but applicable to the first control's Value property not being initialised correctly.
Question3:
What would be the correct approach to implement the DragCompleted event in a MVVM scenario. (Maybe using PRISM EventToCommand mechanism)?
I include a sample project used to test the scenarios. Kindly focus on Page1.xml, Page1.xml.cs and Page1ViewModel.cs that contain the relevant code.
Thank you in advance for having a look into my problem.
Warm regards
Attachment:
Sample1a_bfa0fa72.zip