public DocBuilderWindow(DocBuilderViewModel vm) { InitializeComponent(); _vm = vm; DataContext = vm; }
private void CreateDocumentButton_Click(object sender, RoutedEventArgs e) { var vm = new DocBuilderViewModel(); var window = new DocBuilderWindow(vm); vm.LoadForeignText(Path.Combine(_vm.ProjectPath, _foreignFile)); vm.LoadEnglishText(Path.Combine(_vm.ProjectPath, _englishFile)); var save = window.ShowDialog(); if (save == true) { _vm.UpdatePhrases(vm.ForeignText, vm.EnglishText); } }