示例#1
0
 private void WorkoutDetailEditCommandBinding_OnExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     if (e.Parameter is WorkoutDetail workoutDetail)
     {
         _workoutDetail = workoutDetail;
         GbWorkoutDetail.DataContext = workoutDetail;
         BtnAddWorkoutDetail.Content = new BitmapImage(new Uri("pack://application:,,,/Content/Images/Edit.png"));
     }
 }
示例#2
0
        private void ResetToAddWorkoutDetail(int workoutId, ListCollectionView workoutDetails)
        {
            var workout = _context.Workouts.Include(c => c.Student).SingleOrDefault(c => c.Id == workoutId);

            if (workout != null)
            {
                _workoutDetail = new WorkoutDetail()
                {
                    WorkoutId = workoutId
                };
                GbWorkoutDetail.DataContext = _workoutDetail;
                GbWorkoutDetail.Header      = workout.Title;
                GbWorkoutDetail.IsEnabled   = true;

                GrdWorkoutDetails.ItemsSource = workoutDetails;
                BtnAddWorkoutDetail.Content   = new BitmapImage(new Uri("pack://application:,,,/Content/Images/add.png"));
            }
        }
示例#3
0
        public vwWorkouts(int studentId)
        {
            var splashScreen = new SplashScreenWindow();

            splashScreen.Show();

            InitializeComponent();
            _studentId = studentId;
            CboWorkoutTitles.ItemsSource = _context.WorkoutTitles.ToList();

            _workoutDetail = new WorkoutDetail();
            _workout       = new Workout()
            {
                StudentId = studentId
            };
            GbWorkoutDetail.DataContext = _workoutDetail;
            GbWorkout.DataContext       = _workout;

            BindGrid();

            splashScreen.Close();
        }