|
Telas

Xamarin Forms
using System;
using Xamarin.Forms;
namespace VisualTeste
{
public class App : Application
{
Switch switcher;
Label lb;
public App ()
{
switcher = new Switch ();
Button bt = new Button ();
bt.Text = "Clique";
bt.Clicked += OnButton;
lb = new Label { Text = "TEXTO" };
StackLayout layout = new StackLayout ();
layout.VerticalOptions = LayoutOptions.Center;
layout.Children.Add(switcher);
layout.Children.Add (bt);
layout.Children.Add (lb);
ContentPage pag = new ContentPage ();
pag.Content = layout;
MainPage = pag;
}
private void OnButton(object sender, EventArgs ev)
{
lb.Text = (switcher.IsToggled ? "SIM" : "NÃ");
}
}
}
|