Slider Constructores

Definición

Sobrecargas

Slider()

Inicializa una nueva instancia de la clase Slider.

Slider(Double, Double, Double)

Inicializa una nueva instancia de la clase Slider.

Slider()

Inicializa una nueva instancia de la clase Slider.

public Slider ();

Comentarios

En el ejemplo siguiente se muestra un uso básico.

using System;
using Xamarin.Forms;

namespace FormsGallery
{
    class SliderDemoPage : ContentPage
    {
        Label label;

        public SliderDemoPage()
        {
            Label header = new Label
            {
                Text = "Slider",
                Font = Font.BoldSystemFontOfSize(50),
                HorizontalOptions = LayoutOptions.Center
            };

            Slider slider = new Slider
            {
                Minimum = 0,
                Maximum = 100,
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            slider.ValueChanged += OnSliderValueChanged;

            label = new Label
            {
                Text = "Slider value is 0",
                Font = Font.SystemFontOfSize(NamedSize.Large),
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.CenterAndExpand
            };

            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            // Build the page.
            this.Content = new StackLayout
            {
                Children =
                {
                    header,
                    slider,
                    label
                }
            };
        }

        void OnSliderValueChanged(object sender, ValueChangedEventArgs e)
        {
            label.Text = String.Format("Slider value is {0:F1}", e.NewValue);
        }
    }
}

Se aplica a

Slider(Double, Double, Double)

Inicializa una nueva instancia de la clase Slider.

public Slider (double min, double max, double val);
new Xamarin.Forms.Slider : double * double * double -> Xamarin.Forms.Slider

Parámetros

min
System.Double

Valor mínimo seleccionable.

max
System.Double

Valor máximo seleccionable.

val
System.Double

Valor real.

Se aplica a