|
Tela

Fonte
using System;
using Xamarin.Forms;
namespace Vendas
{
public class Webapi : ContentPage
{
Button botao;
ListView lv;
ActivityIndicator indicador;
public Webapi ()
{
Title = "Tela de Consulta WebService";
botao = new Button ();
botao.Text = "Carregar WebService";
indicador = new ActivityIndicator ();
indicador.IsVisible = false;
botao.Clicked += BotaoClick;
lv = new ListView ();
StackLayout layout = new StackLayout ();
layout.Children.Add (botao);
layout.Children.Add (indicador);
layout.Children.Add (lv);
Content = layout;
}
public async void BotaoClick(object sender, EventArgs e) {
indicador.IsVisible = true;
indicador.IsRunning = true;
lv.ItemsSource = // obtem de um webservice, demora alguns segundos
indicador.IsRunning = false;
indicador.IsVisible = false;
}
}
}
|