private void StartApp(object sender, RoutedEventArgs e) { if (!isRunning) { task.Run(); this.startMenu.IsEnabled = false; this.stopMenu.IsEnabled = true; isRunning = true; this.log.Text += "定时任务启动成功\n"; } }