private void GetTables(object sender, RoutedEventArgs e) { searchbtn.IsEnabled = false; exportbtn.IsEnabled = false; var win = MessageService.GetInstance(); win.ShowMessage("正在加载......"); var temp = Task.Factory.StartNew(() => { model.GetTables(); }); temp.GetAwaiter().OnCompleted(() => { win.CloseMessage(); searchbtn.IsEnabled = true; exportbtn.IsEnabled = true; }); }