Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider: minimum can't be set greater than zero #245

Closed
jwosty opened this issue Dec 6, 2018 · 7 comments
Closed

Slider: minimum can't be set greater than zero #245

jwosty opened this issue Dec 6, 2018 · 7 comments
Labels
t/bug Something isn't working as expected

Comments

@jwosty
Copy link

jwosty commented Dec 6, 2018

This bug is acknowledged in ROADMAP.md, but it didn't yet have an issue, so I thought I'd make it trackable here.

It's currently impossible to create a View.Slider with a minimum value greater than zero because minimum gets set before maximum, causing XF to consider minimum invalid (see: https://forums.xamarin.com/discussion/19131/invalid-value-for-slider-minimum). A fix to this would make sure the minimum gets set after the maximum iff minimum > maximum.

You can work around this for now by using minimum = 0 and doing the math to adjust the value for value and inside valueChanged.

For searchability, here is the exception you get when you try using a positive value for minimum:

System.ArgumentException: Value was an invalid value for Minimum
Parameter name: value
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00098] in <036ea626158e48a4b8dcc52d0593c6a6>:0 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in <036ea626158e48a4b8dcc52d0593c6a6>:0 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <036ea626158e48a4b8dcc52d0593c6a6>:0 
  at Xamarin.Forms.Slider.set_Minimum (System.Double value) [0x00000] in <036ea626158e48a4b8dcc52d0593c6a6>:0 
  at Fabulous.DynamicViews.View.UpdateSlider (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.Slider target) [0x00303] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:3030 
  at <StartupCode$Fabulous-Core>[email protected] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.Slider target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:2992 
  at <StartupCode$Fabulous-Core>.$ViewElement+Create@47-1[T].Invoke (Microsoft.FSharp.Core.FSharpValueOption`1[T] prev, Fabulous.DynamicViews.ViewElement curr, System.Object target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:47 
  at Fabulous.DynamicViews.ViewElement.Create () [0x0000d] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:89 
  at <StartupCode$Fabulous-Core>[email protected] (Fabulous.DynamicViews.ViewElement x) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:4311 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric$cont@244[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update, T[] coll, Microsoft.FSharp.Core.Unit unitVar) [0x000e2] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:258 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, Microsoft.FSharp.Core.FSharpValueOption`1[T] collOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update) [0x00060] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:240 
  at Fabulous.DynamicViews.View.UpdateAbsoluteLayout (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.AbsoluteLayout target) [0x00118] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:4310 
  at <StartupCode$Fabulous-Core>[email protected] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.AbsoluteLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:4292 
  at <StartupCode$Fabulous-Core>.$ViewElement+Create@47-1[T].Invoke (Microsoft.FSharp.Core.FSharpValueOption`1[T] prev, Fabulous.DynamicViews.ViewElement curr, System.Object target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:47 
  at Fabulous.DynamicViews.ViewElement.Create () [0x0000d] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:89 
  at <StartupCode$Fabulous-Core>[email protected] (Fabulous.DynamicViews.ViewElement x) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7235 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric$cont@244[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update, T[] coll, Microsoft.FSharp.Core.Unit unitVar) [0x000e2] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:258 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, Microsoft.FSharp.Core.FSharpValueOption`1[T] collOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update) [0x00060] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:240 
  at Fabulous.DynamicViews.View.UpdateStackLayout (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x001fb] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7234 
  at Fabulous.DynamicViews.View.UpdateFuncStackLayout@ (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>[email protected] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>.$ViewElement+Create@47-1[T].Invoke (Microsoft.FSharp.Core.FSharpValueOption`1[T] prev, Fabulous.DynamicViews.ViewElement curr, System.Object target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:47 
  at Fabulous.DynamicViews.ViewElement.Create () [0x0000d] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:89 
  at <StartupCode$Fabulous-Core>[email protected] (Fabulous.DynamicViews.ViewElement x) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7235 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric$cont@244[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update, T[] coll, Microsoft.FSharp.Core.Unit unitVar) [0x000e2] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:258 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, Microsoft.FSharp.Core.FSharpValueOption`1[T] collOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update) [0x00060] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:240 
  at Fabulous.DynamicViews.View.UpdateStackLayout (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x001fb] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7234 
  at Fabulous.DynamicViews.View.UpdateFuncStackLayout@ (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>[email protected] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>.$ViewElement+Create@47-1[T].Invoke (Microsoft.FSharp.Core.FSharpValueOption`1[T] prev, Fabulous.DynamicViews.ViewElement curr, System.Object target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:47 
  at Fabulous.DynamicViews.ViewElement.Create () [0x0000d] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:89 
  at <StartupCode$Fabulous-Core>[email protected] (Fabulous.DynamicViews.ViewElement x) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7235 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric$cont@244[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update, T[] coll, Microsoft.FSharp.Core.Unit unitVar) [0x000e2] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:258 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, Microsoft.FSharp.Core.FSharpValueOption`1[T] collOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update) [0x00060] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:240 
  at Fabulous.DynamicViews.View.UpdateStackLayout (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x001fb] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7234 
  at Fabulous.DynamicViews.View.UpdateFuncStackLayout@ (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>[email protected] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>.$ViewElement+Create@47-1[T].Invoke (Microsoft.FSharp.Core.FSharpValueOption`1[T] prev, Fabulous.DynamicViews.ViewElement curr, System.Object target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:47 
  at Fabulous.DynamicViews.ViewElement.Create () [0x0000d] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:89 
  at <StartupCode$Fabulous-Core>[email protected] (Fabulous.DynamicViews.ViewElement x) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7235 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric$cont@244[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update, T[] coll, Microsoft.FSharp.Core.Unit unitVar) [0x000e2] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:258 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, Microsoft.FSharp.Core.FSharpValueOption`1[T] collOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update) [0x00060] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:240 
  at Fabulous.DynamicViews.View.UpdateStackLayout (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x001fb] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7234 
  at Fabulous.DynamicViews.View.UpdateFuncStackLayout@ (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>[email protected] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>.$ViewElement+Create@47-1[T].Invoke (Microsoft.FSharp.Core.FSharpValueOption`1[T] prev, Fabulous.DynamicViews.ViewElement curr, System.Object target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:47 
  at Fabulous.DynamicViews.ViewElement.Create () [0x0000d] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:89 
  at <StartupCode$Fabulous-Core>[email protected] (Fabulous.DynamicViews.ViewElement x) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7235 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric$cont@244[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update, T[] coll, Microsoft.FSharp.Core.Unit unitVar) [0x000e2] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:258 
  at Fabulous.DynamicViews.Converters.updateCollectionGeneric[T,TargetT] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevCollOpt, Microsoft.FSharp.Core.FSharpValueOption`1[T] collOpt, System.Collections.Generic.IList`1[T] targetColl, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] create, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] attach, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] canReuse, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] update) [0x00060] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewConverters.fs:240 
  at Fabulous.DynamicViews.View.UpdateStackLayout (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x001fb] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7234 
  at Fabulous.DynamicViews.View.UpdateFuncStackLayout@ (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>[email protected] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.StackLayout target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:7204 
  at <StartupCode$Fabulous-Core>.$ViewElement+Create@47-1[T].Invoke (Microsoft.FSharp.Core.FSharpValueOption`1[T] prev, Fabulous.DynamicViews.ViewElement curr, System.Object target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:47 
  at Fabulous.DynamicViews.ViewElement.Create () [0x0000d] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:89 
  at Fabulous.DynamicViews.View.UpdateContentPage (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.ContentPage target) [0x00295] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:8966 
  at <StartupCode$Fabulous-Core>[email protected] (Microsoft.FSharp.Core.FSharpValueOption`1[T] prevOpt, Fabulous.DynamicViews.ViewElement curr, Xamarin.Forms.ContentPage target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\Xamarin.Forms.Core.fs:8936 
  at <StartupCode$Fabulous-Core>.$ViewElement+Create@47-1[T].Invoke (Microsoft.FSharp.Core.FSharpValueOption`1[T] prev, Fabulous.DynamicViews.ViewElement curr, System.Object target) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:47 
  at Fabulous.DynamicViews.ViewElement.Create () [0x0000d] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ViewElement.fs:89 
  at Fabulous.Core.ProgramRunner`2[model,msg]..ctor (Xamarin.Forms.Application app, Fabulous.Core.Program`3[model,msg,view] program) [0x0007a] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ElmishProgram.fs:53 
  at Fabulous.Core.ProgramModule.runWithDynamicView[model,msg] (Xamarin.Forms.Application app, Fabulous.Core.Program`3[model,msg,view] program) [0x00000] in C:\projects\elmish-xamarinforms\src\Fabulous.Core\ElmishProgram.fs:227 
  at CueComposer.App+App..ctor (CueComposer.Api+IAudioInterface audioInterface) [0x00016] in /Users/jwostenberg/Code/FSharp/CueComposer/CueComposer/App.fs:246 
  at CueComposer.MacOS.AppDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x0000b] in /Users/jwostenberg/Code/FSharp/CueComposer/CueComposer.MacOS/AppDelegate.fs:83 
  at (wrapper managed-to-native) AppKit.NSApplication.NSApplicationMain(int,string[])
  at AppKit.NSApplication.Main (System.String[] args) [0x00040] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.2.1.11/src/Xamarin.Mac/AppKit/NSApplication.cs:100 
  at CueComposer.MacOS.main.main (System.String[] args) [0x00014] in /Users/jwostenberg/Code/FSharp/CueComposer/CueComposer.MacOS/Main.fs:10 
@TimLariviere TimLariviere added the t/bug Something isn't working as expected label Dec 6, 2018
@TimLariviere
Copy link
Member

Thanks. Thought this one was handled and forgot about the roadmap.
I think it should be easy to fix.

@TimLariviere
Copy link
Member

TimLariviere commented Dec 6, 2018

Ok, so not as easy as I thought after all. :)
If the new minimum > old maximum, it throws, as well as new maximum < old minimum.

A good way to ensure we're correctly updating the slider, I think, is to enforce setting Minimum and Maximum at the same time instead of separately.
It changes a bit from Xamarin.Forms, but I think it makes more sense to do so.

View.Slider(
     minimumMaximum=(10.0, 25.0)
)

@jwosty
Copy link
Author

jwosty commented Dec 6, 2018

@TimLariviere This breaks backwards compatibility though; doesn't it? Perhaps it is worth it though.

(I can't speak to the correct solution though as I haven't dug into the sources :) )

@jwosty
Copy link
Author

jwosty commented Dec 6, 2018

Do we also have to factor value into all of this?

@TimLariviere
Copy link
Member

TimLariviere commented Dec 6, 2018

Yes, this breaks backwards compatibility.
We're generating the properties independently, so it seemed quite a lot of work just to allow for this kind of dynamic precedence between 2 properties.
And this new property makes a lot more sense to me than independently managing Minimum and Maximum. (name can be better though)
If you change one side, you usually rely on the other side to be a certain value, so better be explicit about it.

Given we've not yet reached v1.0, I think it's ok.

As far as I tested it, value follows just fine without changing it.
If it goes out of bounds, it's automatically adjusted to the nearest bound.

@jwosty
Copy link
Author

jwosty commented Dec 6, 2018

OK, sounds good then!

@charlesroddie
Copy link

The proposed solution is good but I think it needs to be MinimumValueMaximum not just MinimumMaximum.

The bug can also be fixed in Xamarin.Forms xamarin/Xamarin.Forms#1943 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants