2013-03-04 200 views
1

有人可以給我一個如何使用方法開始向用戶顯示警報的例子說加載... 隨着下面的代碼我使用Completed事件放置查詢,使用方法作爲開始?C#異步Web服務

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

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

回答

2

只要將簡單的文本塊或者是這樣的:

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