Exemplo n.º 1
0
        /// <summary>
        /// edit current user's workout
        /// </summary>
        private void EditWorkout(object obj)
        {
            PhysicalActivity activity = new PhysicalActivity();

            activity = null;
            SetProgressBar(activity);

            RightUserControl = null;

            if (RightUserControl == null)
            {
                EditWorkoutViewModel editWorkoutViewModel = new EditWorkoutViewModel(CurrentUser, this);
                EditWorkout          editWorkout          = new EditWorkout
                {
                    DataContext = editWorkoutViewModel
                };

                RightUserControl = editWorkout;
                WelcomeMessage   = null;
            }
            else
            {
                RightUserControl = null;
            }
        }
Exemplo n.º 2
0
        public async Task Edit(EditWorkout item)
        {
            var workout = await _db.Workouts.SingleAsync(w => w.Id == item.Id);

            workout.Name = item.Name;

            await _db.SaveChangesAsync();
        }
Exemplo n.º 3
0
        /// <summary>
        /// clears the form
        /// </summary>
        private void Clear(object obj)
        {
            EditWorkout editWorkout = new EditWorkout
            {
                DataContext = this
            };

            Message = null;
            ResetInputBoxes();
            if (obj is System.Windows.Controls.UserControl)
            {
                (obj as System.Windows.Controls.UserControl).Content = editWorkout;
            }
        }