private void MoveDown(DataFolderViewModel dataFolderViewModel) { var index = DataFolders.IndexOf(dataFolderViewModel); if (index < 0 || index >= DataFolders.Count - 1) { return; } DataFolders.RemoveAt(index); DataFolders.Insert(index + 1, dataFolderViewModel); }
private void MoveUp(DataFolderViewModel dataFolderViewModel) { var index = DataFolders.IndexOf(dataFolderViewModel); if (index <= 0) { return; } DataFolders.RemoveAt(index); DataFolders.Insert(index - 1, dataFolderViewModel); }
public void AddFolder() { var dialog = new CommonOpenFileDialog(); dialog.IsFolderPicker = true; if (dialog.ShowDialog() == CommonFileDialogResult.Ok) { DataFolders.Insert(0, new DataFolderViewModel(this) { Path = dialog.FileName, IsEnabled = true }); UpdateArrowButtons(); } }