private async void AddTask(object sender, RoutedEventArgs e) { var id = Guid.NewGuid().ToString("N"); await _controller.AddTask(new TaskModel { Id = id, Color = new SolidColorBrush(Colors.OrangeRed), List = new List <TaskText>(), Name = "Default Name", Opacity = 0.9 }); var task = new TaskWindow(_controller, id); task.DeleteTask.Click += DeleteTask; task.ShowTaskList.Click += ShowTaskList; task.AddTask.Click += AddTask; task.Show(); ShowTaskList(); }