private void btnEditMonograph_Click(object sender, RoutedEventArgs e) { var view = new MonographView(); var monographViewModel = (MonographViewModel)((Button)sender).DataContext; monographViewModel.Mode = Mode.Edit; view.DataContext = monographViewModel; view.ShowDialog(); }
private void btnAddMonograph_Click(object sender, RoutedEventArgs e) { var view = new MonographView(); var monographViewModel = new MonographViewModel() { Researcher = (ResearcherViewModel)DataContext, Mode = Mode.Add }; view.DataContext = monographViewModel; view.ShowDialog(); }