private void ButtonMoveDownAction_Click(object sender, RoutedEventArgs e) { var task = (sender as Button).DataContext as GameTask; var index = TempOtherTasks.IndexOf(task); if (index != TempOtherTasks.Count - 1) { TempOtherTasks.Move(index, index + 1); } }
private void ButtonAddAction_Click(object sender, RoutedEventArgs e) { if (TempOtherTasks == null) { TempOtherTasks = new ObservableCollection <GameTask>(); OtherTasksItems.ItemsSource = TempOtherTasks; } var newTask = new GameTask() { Name = "New Action", IsBuiltIn = false }; if (TempPlayTask != null && TempPlayTask.Type == GameTaskType.File) { newTask.WorkingDir = TempPlayTask.WorkingDir; newTask.Path = TempPlayTask.Path; } TempOtherTasks.Add(newTask); }
private void ButtonDeleteAction_Click(object sender, RoutedEventArgs e) { var task = ((Button)sender).DataContext as GameTask; TempOtherTasks.Remove(task); }