예제 #1
0
        /// <summary>
        /// view current user's workouts
        /// </summary>
        private void ViewWorkouts(object obj)
        {
            RightUserControl = null;

            if (RightUserControl == null)
            {
                WorkoutViewModel workoutViewModel = new WorkoutViewModel(CurrentUser, this);
                UserWorkouts     userWorkouts     = new UserWorkouts();
                userWorkouts.DataContext = workoutViewModel;

                RightUserControl = userWorkouts;
                WelcomeMessage   = null;
            }
            else
            {
                RightUserControl = null;
            }
        }
예제 #2
0
        /// <summary>
        /// edits the selected task
        /// </summary>
        private void EditUserWorkout(object obj)
        {
            WorkoutViewModel workoutViewModel = new WorkoutViewModel(CurrentUser, _dashboardWindowViewModel);
            UserWorkouts     userWokouts      = new UserWorkouts
            {
                DataContext = workoutViewModel
            };

            //Task task = CreateTask();
            if (SelectedWorkout != null)
            {
                Enum.TryParse(CategoryToEdit, out PhysicalActivity.ExerciseType category);
                SelectedWorkout.TypeOfExercise = category;
                _myWellnessAppBusiness.EditExercise(CurrentUser, SelectedWorkout);
                _currentUserWorkouts = new ObservableCollection <PhysicalActivity>(CurrentUser.PhysicalActivities);
                _dashboardWindowViewModel.SetProgressBar(SelectedWorkout = null);
                if (obj is System.Windows.Controls.UserControl)
                {
                    (obj as System.Windows.Controls.UserControl).Content = userWokouts;
                }
            }
        }