private void ArticlesList_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var article = (ArticleDTO)ArticlesList.SelectedItem; ArticleDetails newWindow = new ArticleDetails(article); newWindow.ShowDialog(); }
private void ArticlesList_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (ArticlesList.SelectedItem != null) { ArticleDetails newWindow = new ArticleDetails((ArticleDTO)ArticlesList.SelectedItem); newWindow.ShowDialog(); } }
private async void Button_Click(object sender, RoutedEventArgs e) { var article = await articleCore.GetArticleByIdAsync(presentation.ArticleId); if (article != null) { ArticleDetails newWindow = new ArticleDetails(article); newWindow.ShowDialog(); } }
private async void EditArticles_Click(object sender, RoutedEventArgs e) { if (ArticleDataGrid.SelectedIndex >= 0) { var article = await articleCore.GetArticleByIdAsync(((ArticleDTO)ArticleDataGrid.SelectedItem).ArticleId); ArticleDetails newArticleDetailsWindow = new ArticleDetails(article); newArticleDetailsWindow.ShowDialog(); } else { MessageBox.Show("Choose article first"); } }