示例#1
0
        private void Export(object sender, RoutedEventArgs e)
        {
            exportbtn.IsEnabled = true;
            var win = MessageService.GetInstance();

            win.ShowMessage("正在导出.....");
            var task = Task.Factory.StartNew(() => model.HandleDbToFile());

            task.GetAwaiter().OnCompleted(() =>
            {
                win.CloseMessage();
                MessageBox.Show("完成导出");
                exportbtn.IsEnabled = true;
            });
        }