/// <summary> /// Event handler for the show progress button with a timer. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event args.</param> private void Show_Templated_Progress_With_Time_Limit(object sender, RoutedEventArgs e) { Task.Run(() => { DispatchHelper.InvokeOnUIThread(async() => { await this.altProgressDialog.ShowAsync(); }); }); Task.Run(async() => { await Task.Delay(TimeSpan.FromSeconds(4)); DispatchHelper.InvokeOnUIThread(() => { this.altProgressDialog.Hide(); }); }); }
/// <summary> /// Event handler for the show progress button with a timer. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event args.</param> private void Show_Inplace_Progress_With_Time_Limit(object sender, RoutedEventArgs e) { Task.Run(() => { DispatchHelper.InvokeOnUIThread(async() => { this.dialogContainer.Visibility = Visibility.Visible; await this.progressDialog.ShowAsync(ContentDialogPlacement.InPlace); }); }); Task.Run(async() => { await Task.Delay(TimeSpan.FromSeconds(4)); DispatchHelper.InvokeOnUIThread(() => { this.progressDialog.Hide(); this.dialogContainer.Visibility = Visibility.Collapsed; }); }); }