private void climbPath_Click(object sender, RoutedEventArgs e) { Button btn = (sender as Button); System.Windows.Controls.Image img = (btn.Content as Image); training l_training = trainingDataGrid.SelectedItem as training; if (l_training != null) { if (DetailsImage == c_grapplesImage) { ClimbPathView l_usrPage = new ClimbPathView(l_training, db_context); viewFrame.Content = l_usrPage; DetailsImage = c_plotsImage; img.Source = _plotsBmi; _detailsBtnLable.Content = "Полотна"; } else { TrainingView l_usrPage = new TrainingView(l_training, db_context); viewFrame.Content = l_usrPage; DetailsImage = c_grapplesImage; img.Source = _grapplesBmi; _detailsBtnLable.Content = "Зацепы"; } } }
private void trainingDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { training l_training = trainingDataGrid.SelectedItem as training; if (l_training != null) { if (DetailsImage == c_grapplesImage) { TrainingView l_usrPage = new TrainingView(l_training, db_context); viewFrame.Content = l_usrPage; } else { ClimbPathView l_usrPage = new ClimbPathView(l_training, db_context); viewFrame.Content = l_usrPage; } } }