void EditContact_Execute(object parameters) { if (parameters == null) return; EditorWindow dialog = new EditorWindow(); EditorViewModel editorViewModel = new EditorViewModel((parameters as OriginReference.Origin)); _modalDialogService.ShowDialog<EditorViewModel>(dialog, editorViewModel, returnedViewModelInstance => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { OriginReference.Origin result = editorViewModel.ObjectResult; _originClient.EditOriginAsync(result); } }); }
void AddContact_Execute(object parameters) { OriginReference.Origin temporalLanguage = new OriginReference.Origin { OriginId = 0, OriginName = "", OriginUrl = "" }; EditorWindow dialog = new EditorWindow(); EditorViewModel editorViewModel = new EditorViewModel(temporalLanguage); _modalDialogService.ShowDialog<EditorViewModel>(dialog, editorViewModel, returnedViewModelInstance => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { OriginReference.Origin result = editorViewModel.ObjectResult; _originClient.CreateOriginAsync(result); } }); }