private void Remove_Task_Click(object sender, RoutedEventArgs e) { var selectedTask = (Task)listView.SelectedItem; TaskController.RemoveItem(selectedTask.Id); }