Пример #1
0
 void EditContact_Execute(object parameters)
 {
     if (parameters == null)
         return;
     EditorWindow dialog = new EditorWindow();
     EditorViewModel editorViewModel = new EditorViewModel((parameters as LanguageReference.Language));
     _modalDialogService.ShowDialog<EditorViewModel>(dialog,
         editorViewModel,
         returnedViewModelInstance =>
         {
             if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
             {
                 LanguageReference.Language result = editorViewModel.ObjectResult;
                 _languageClient.EditLanguageAsync(result);
             }
         });
 }
Пример #2
0
 void AddContact_Execute(object parameters)
 {
     LanguageReference.Language temporalLanguage = new LanguageReference.Language { LanguageId = 0, LanguageName = "" };
     EditorWindow dialog = new EditorWindow();
     EditorViewModel editorViewModel = new EditorViewModel(temporalLanguage);
     _modalDialogService.ShowDialog<EditorViewModel>(dialog,
         editorViewModel,
         returnedViewModelInstance =>
         {
             if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
             {
                 LanguageReference.Language result = editorViewModel.ObjectResult;
                 _languageClient.CreateLanguageAsync(result);
             }
         });
 }