public ManageDataSetViewModel(IDataSetManager dataSetManager, DialogHandler dialogHandler) { _dataSetManager = dataSetManager; _dialogHandler = dialogHandler; AddCommand = new RelayCommand(async() => await Add()); CloneDatasetCommand = new RelayCommand(async() => await Add(SelectedDataSet)); ImportDocumentCommand = new RelayCommand(ImportJson <object>); ImportTagCommand = new RelayCommand(ImportJson <Tag>); ImportDocumentCsvCommand = new RelayCommand(ImportCsv <object>); ImportTagCsvCommand = new RelayCommand(ImportCsv <Tag>); DoubleClickCommand = new RelayCommand(() => { if (SelectedDataSet != null) { Messenger.Default.Send(new UpdateMessage(UpdateType.OpenNewTab, new HeaderedItemViewModel(SelectedDataSet.Name + " -Data", new ManageData { DataContext = new ManageDataViewModel(SelectedDataSet, _dialogHandler) }, true))); } }); DeleteCommand = new RelayCommand(Delete); RenameCommand = new RelayCommand(Rename); LoadedCommand = new RelayCommand(async() => { try { Mouse.SetCursor(Cursors.Arrow); if (_loadedFirst) { _loadedFirst = false; await _dialogHandler.ShowProgress(null, async() => { DispatcherHelper.CheckBeginInvokeOnUI(() => DataSets.Clear()); var response = await _dataSetManager.GetDataSetsAsync(); if (ResponseValidator.Validate(response)) { DispatcherHelper.CheckBeginInvokeOnUI(() => { response.ResponseObject.ToList().ForEach(ds => DataSets.Add(ds)); }); } }); } } catch (Exception exception) { Messenger.Default.Send(exception); } }); }