-1
我的代碼進度對話框不顯示
protected async Task SyncAll()
{
var ProgressAlert = await this.ShowProgressAsync("Please wait...", "Sync...."); //show message
ProgressAlert.SetIndeterminate(); //Infinite
try
{
//some magic code here
//show info
await ProgressAlert.CloseAsync();
await this.ShowMessageAsync("End","Succes!");
}
catch
{
await ProgressAlert.CloseAsync();
await this.ShowMessageAsync("Error!", "Contact with support");
}
}
private async void SyncButton_Click(object sender, RoutedEventArgs e)
{
await SyncAll();
}
,我只收到一個暗淡的窗口並沒有ProgressDialog。 我想執行我的代碼,並用ProgressDialog實例操縱他。
我做錯了什麼?
你想做什麼? 你能寫英文的messagebox文字嗎?所以我們可以很好理解... – ghiboz
這沒關係,我想顯示ProgressDialog,在try塊中做一些事情,並隱藏ProgressDialog。 – user3468055
「幻碼」是不是阻塞(即正確使用)? – thumbmunkeys