Stepper in Xamarin Forms

Hi There, I want to use a Xamarin.Forms stepper to add quantity. I searched a lot but I couldn't find any proper solution for this. I want to customize it like it's buttoned width, color, and most important, I want to insert label between stepper.

If you guys have suggestions for adding quantity for items in xamarin forms, please let me know.

Thanks in Advance

Best Answer

Answers

  • Sahadev_GuptaSahadev_Gupta INMember ✭✭✭

    @MohammedDastagir you can create custom stepper and add any property you would like to

  • @Sahadev_Gupta Thanks for your response. It will be appreciated if you tell me how to do it. I tried some custom renderers but it's working the same way the stepper does.

  • Sahadev_GuptaSahadev_Gupta INMember ✭✭✭

    <Controls:CustomStepper Text="{Binding Quantity}" />

  • Thanks for this. Please share DecimalNumberValidationBehavior method

  • Thank you @Sahadev_Gupta . You are Amazing. It worked amazingly. Happy Coding!

  • Sahadev_GuptaSahadev_Gupta INMember ✭✭✭
  • mhmdmhmd Member ✭✭

    @MohammedDastagir said:
    Thanks for this. Please share DecimalNumberValidationBehavior method

    Did you get this method? Please share it and thank you.

  • mhmdmhmd Member ✭✭

    @mhmd said:

    @MohammedDastagir said:
    Thanks for this. Please share DecimalNumberValidationBehavior method

    Did you get this method? Please share it and thank you.

    Sorry for that, didn't realize its a behavior, I already have one so I used it.

    I need to use this in a listview and get the value of the stepper every time it changes, how this can be done?

  • @mhmd sorry for late reply. You just have to make a void method. Create int variable and assign a value to that variable from Entry_Textchanged. Using that void method, you can get the value of the stepper.

    Have a look on this:

             private void Entry_TextChanged(object sender, TextChangedEventArgs e)
                    {
                        if (!string.IsNullOrEmpty(e.NewTextValue))
                            this.Text = int.Parse(e.NewTextValue);
                        Quan.Text = e.NewTextValue;
                        Val = int.Parse(Quan.Text);
                    }
                    public int GetValue()
                    {
                        int Value= Val;
                        return Value;
                    }
    
Sign In or Register to comment.