Created
March 31, 2015 22:00
-
-
Save adrianstevens/19530b8992a3a9107da7 to your computer and use it in GitHub Desktop.
Xamarin Forms Stepper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public App () | |
{ | |
int count = 0; | |
var myPage = new ContentPage (); | |
var stepperlabel = new Label | |
{ | |
Text = "Stepper value is 0", | |
HorizontalOptions = LayoutOptions.Center, | |
VerticalOptions = LayoutOptions.CenterAndExpand | |
}; | |
var stepper = new Stepper | |
{ | |
Minimum = 0, | |
Maximum = 10, | |
Increment = 0.1, | |
HorizontalOptions = LayoutOptions.Center, | |
VerticalOptions = LayoutOptions.CenterAndExpand | |
}; | |
stepper.ValueChanged += (object sender, ValueChangedEventArgs e) => | |
{ | |
stepperlabel.Text = String.Format("Stepper value is {0:F1}", e.NewValue); | |
}; | |
var myStack = new StackLayout (); | |
myStack.Children.Add (stepper); | |
myStack.Children.Add (stepperlabel); | |
myPage.Content = myStack; | |
this.MainPage = myPage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment