pattrick
pattrick

Reputation: 41

C# Async WebService

Can someone give me an example of how to use the method begin to display an alert to the User saying Loading ... With the code below I place the query using the Completed event, use the method as Begin?

service.EventosDoDiaCompleted += RecebeEventos;
service.EventosDoDiaAsync();

private void RecebeEventos(object sender, AsyncCompletedEventArgs e)
{
   Dataset ds = service.EventosDoDia();
}

Upvotes: 1

Views: 551

Answers (1)

Norbert Pisz
Norbert Pisz

Reputation: 3440

Just place simple Textblock or something like this:

    service.EventosDoDiaCompleted += RecebeEventos;
    textblock.Text="Loading....";
    service.EventosDoDiaAsync();
    private void RecebeEventos(object sender, AsyncCompletedEventArgs e)
    {
        textblock.Text="Loaded";
        Dataset ds = service.EventosDoDia();
    }

Upvotes: 2

Related Questions