public void ShowCancelableAwait() { PUMessageBox.ShowAwait("正在执行......", delegate { PUMessageBox.CloseAwait(); }); }
public void ShowCancelableAwait() { PUMessageBox.ShowAwait("正在执行......", delegate { PUMessageBox.CloseAwait(delegate { PUMessageBox.ShowDialog("任务已取消。"); }); }); }
/// <summary> /// 使用数字作为参数不是一个好方法,这里为了方便 /// </summary> /// <param name="category"></param> public void Display(int category) { switch (category) { case 1: var window1 = new Views.Control.Examples.MultiNavWindow(); window1.ShowDialog(); if (!window1.Result.Equals(0)) { PUMessageBox.ShowDialog("最后点击的按钮(缩放和关闭按钮不算)是第" + window1.Result + "个"); } break; case 2: var window2 = new Views.Control.Examples.LoginWindow(); window2.Owner = (Parent as ShellWindowViewModel).GetCurrentWindow(); window2.ShowDialog(); break; case 3: var window4 = new Views.Control.Examples.ChatWindow(); window4.ShowDialog(); break; case 4: SetAwait(true); Task.Run(() => { Thread.Sleep(2000); App.Current.Dispatcher.Invoke(() => { SetAwait(false); }); }); break; case 5: PUMessageBox.ShowDialog("Hello World"); break; case 6: PUMessageBox.ShowConfirm("Hello World"); break; case 7: PUMessageBox.ShowAwait("正在执行......", delegate { PUMessageBox.CloseAwait(delegate { PUMessageBox.ShowDialog("已取消。"); }); }); break; } }
private void Webview_NavigationStarting(object sender, WebViewControlNavigationStartingEventArgs e) { if (isLoading == false) { webview.Visibility = Visibility.Hidden; PUMessageBox.ShowAwait("努力加载中....", "超星尔雅刷课", new RoutedEventHandler((object obj, RoutedEventArgs arg) => { if (webview.CanGoBack) { webview.GoBack(); } }), AnimationStyles.Gradual ); isLoading = true; } startWarning.Visibility = Visibility.Collapsed; }