Stepper

A Stepper is a control for selecting a numeric value from a range of values.


            <StackLayout Margin="10">
                <Label x:Name="stepperLabel"
                        Text="0"
                        FontSize="Large"
                        HorizontalOptions="Center"
                        VerticalOptions="CenterAndExpand" />
                <Stepper Minimum="0"
                            Maximum="100"
                            Value="0"
                            Increment="5"
                            HorizontalOptions="Center"
                            ValueChanged="OnStepperValueChanged" />
            </StackLayout>                
                

  • Minimum is the minimum value of the range with a default of 0.
  • Maximum is the maximum value of the range with a default of 100.
  • Value is the stepper's value, which can range between Minimum and Maximum with a default value of 0.
  • Increment is the amount to increment/decrement the selected value by with a default value of 1.

Code Behind


        void OnStepperValueChanged(object sender, ValueChangedEventArgs e)
        {
            stepperLabel.Text = e.NewValue.ToString();
        }                    
                

Download

.NET MAUI