Ejemplo n.º 1
0
        private void btnEditArticle_Click(object sender, RoutedEventArgs e)
        {
            var view             = new ArticleView();
            var articleViewModel = (ArticleViewModel)((Button)sender).DataContext;

            articleViewModel.Mode = Mode.Edit;
            view.DataContext      = articleViewModel;
            view.ShowDialog();
        }
Ejemplo n.º 2
0
        private void btnAddArticle_Click(object sender, RoutedEventArgs e)
        {
            var view             = new ArticleView();
            var articleViewModel = new ArticleViewModel()
            {
                Researcher = (ResearcherViewModel)DataContext,
                Mode       = Mode.Add
            };

            view.DataContext = articleViewModel;
            view.ShowDialog();
        }