private void ResetTask() { if (Running) { HandyControl.Controls.Growl.Error("其他任务正在进行!", "BatchGrowl"); return; } vieModel.Reset(); }
private async Task <bool> ResetTask() { if (Running) { HandyControl.Controls.Growl.Error("其他任务正在进行!", "BatchGrowl"); return(false); } WaitingPanel.Visibility = Visibility.Visible; return(await Task.Run(() => { return vieModel.Reset((message) => { Dispatcher.BeginInvoke((Action) delegate { WaitingPanel.Visibility = Visibility.Collapsed; }); }); })); }