private void NewTaskButton_Click(object sender, RoutedEventArgs e) { if (TaskTextBox.Text == currentTasker.Task) { return; } if (currentTasker.Task != string.Empty) { currentTasker.Save(); } string newTask = TaskTextBox.Text; currentTasker = new Tasker(newTask, configuration); CurrentTaskLabel.Content = string.Format("In progress: {0}", currentTasker.Task); TaskTextBox.Text = string.Empty; }
public MainWindow() { InitializeComponent(); configuration = new Configuration(); currentTasker = new Tasker(string.Empty, configuration); int minutes = configuration.TimePeriod; main = this; async Task RunPeriodicSave() { while (true) { await Task.Delay(minutes * 60 * 1000); OnTop(); } } RunPeriodicSave(); }