Search code examples
c#xamarinargumentexception

Why doesn't it work to put minimum 100 on stepper class in Xamarin?


I don't understand why I got this message. I asked someone, he said that it doesn't like 100, but I still wonder why.

I got this message....


Solution

  • The reason can be found in the documents:

    Minimum - An integer or decimal literal. If this value is nonnegative, it must appear lexically below Maximum, so that validation can succeed.

    Which means you must declare the stepper as such:

    stepper = new Stepper {
       Maximum = 200, //note that maximum is declared first.
       Minimum = 100,
       Value = 100,       
       Increment = 10
    };