Exemple #1
0
 void AddPhrase_Execute(object parameters)
 {
     CompletePhrase temporalPhrase = new CompletePhrase(new PhraseReference.Phrase(), new TranslationReference.Translation());
     temporalPhrase.Translation.PhraseByDefault = true;
     EditorViewModel editorViewModel = new EditorViewModel(temporalPhrase);
     EditorWindow dialog = new EditorWindow(editorViewModel);
     _modalDialogService.ShowDialog<EditorViewModel>(dialog,
         editorViewModel,
         returnedViewModelInstance =>
         {
             if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
             {
                 PhraseReference.Phrase result = editorViewModel.PhraseResult;
                 _temporalPhraseTranslation = editorViewModel.TranslationResult;
                 _phraseClient.CreatePhraseAsync(result);
             }
         });
 }
Exemple #2
0
 void EditPhrase_Execute(object parameters)
 {
     if (parameters == null)
         return;
     CompletePhrase temporalPhrase = (parameters as CompletePhrase);
     EditorViewModel editorViewModel = new EditorViewModel(temporalPhrase);
     EditorWindow dialog = new EditorWindow(editorViewModel);
     _modalDialogService.ShowDialog<EditorViewModel>(dialog,
         editorViewModel,
         returnedViewModelInstance =>
         {
             if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
             {
                 PhraseReference.Phrase result = editorViewModel.PhraseResult;
                 _temporalPhraseTranslation = editorViewModel.TranslationResult;
                 _phraseClient.EditPhraseAsync(result);
             }
         });
 }
 public EditorWindow(EditorViewModel viewModel)
 {
     InitializeComponent();
     this.ViewModel = viewModel;
     this.DataContext = this.ViewModel;
 }