diff options
Diffstat (limited to 'Xamarin.Forms.Controls/GalleryPages/SwitchGallery.cs')
-rw-r--r-- | Xamarin.Forms.Controls/GalleryPages/SwitchGallery.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/SwitchGallery.cs b/Xamarin.Forms.Controls/GalleryPages/SwitchGallery.cs new file mode 100644 index 00000000..efdf623b --- /dev/null +++ b/Xamarin.Forms.Controls/GalleryPages/SwitchGallery.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Xamarin.Forms.Controls +{ + public class SwitchGallery : ContentPage + { + public SwitchGallery () + { + var testLabel = new Label { + Text = "Test Label" + }; + + var normal = new Switch { IsToggled = true }; + var disabled = new Switch (); + var transparent = new Switch (); + var stepper = new Stepper (); + + normal.Toggled += (sender, e) => { + testLabel.Text = "Toggled normal switch"; + }; + + disabled.Toggled += (sender, e) => { + testLabel.Text = "Toggled disabled switch (magic)"; + }; + + transparent.Toggled += (sender, e) => { + testLabel.Text = "Toggled transparent switch"; + }; + + stepper.ValueChanged += (sender, e) => { + testLabel.Text = stepper.Value.ToString (); + }; + + disabled.IsEnabled = false; + transparent.Opacity = 0.5; + + Content = new StackLayout { + Padding = new Thickness (20), + Children = { + testLabel, + normal, + disabled, + transparent, + stepper, + } + }; + } + } +} |