Bug 23665 - Slider properties should not be sequence dependant
Summary: Slider properties should not be sequence dependant
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-10-07 07:03 UTC by Brian Taylor
Modified: 2016-03-18 08:18 UTC (History)
7 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Brian Taylor 2014-10-07 07:03:09 UTC
If the properties are entered as
<Slider HorizontalOptions="CenterAndExpand" ValueChanged="OnSliderValueChanged" Value="360" Minimum="1" Maximum="4000" />

An exception will be throw
<Slider HorizontalOptions="CenterAndExpand" ValueChanged="OnSliderValueChanged" Maximum="4000"  Minimum="1" Value="360" />

Comment 1 Sadik Ali 2014-10-07 10:14:06 UTC
I have checked this issue and able to reproduce reported behavior. To reproduce this issue I have followed steps mentioned below:

1. Create a Xamarin Forms Application(Portable)
2. Add n xaml page to it named "MyPage" and call in App.cs
3. Add the following code to "MyPage.xaml"
<Slider HorizontalOptions="CenterAndExpand" Value="360" Minimum="1" Maximum="4000"/>
4. Build and run the application 
5. Observe that you will get the below exception:
 "Value was an invalid value for Minimum Parameter name:value"
6. Now change the sequence of properties in "MyPage.xaml" :
  <Slider HorizontalOptions="CenterAndExpand" Maximum="4000" Minimum="1" Value="360"/>
7. Run the application observe it will deploy successfully without exception

Please let me know the is this the same behavior/exception you are experiencing, shown in the screencast ? If no then could you please provide us steps/small sample application to reproduce this issue. That will be helpful to reproduce this issue at our end.

Screencast: http://www.screencast.com/t/oXF64hVRr

Environment Info:
=== Xamarin Studio ===

Version 5.5 (build 227)
Installation UUID: a7e29e93-6348-4126-9ebc-b2777c96a552
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 4.18.0 (Business Edition)
Android SDK: E:\android-sdk
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode)

=== Build Information ===

Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-02 15:51:22-04
Xamarin addins: 99ed56b428b31eba1efaace4d82188d6f334e6ca

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 2 Kraig Brockschmidt 2015-03-06 17:46:38 UTC
I believe this bug is due to the Slider attempting to validate Minimum against Maximum, but if Max hasn't been set, it'll throw. This is why listing Maximum first works. See also bug 21181 https://bugzilla.xamarin.com/show_bug.cgi?id=21181.
Comment 5 Jason Smith [MSFT] 2016-03-18 08:18:59 UTC
Thank you for your suggestion, we are aware of this problem and are looking into non-backwards compat breaking fixes