コード例 #1
0
        private void rbtnPublish_Click(object sender, RoutedEventArgs e)
        {
            if (TrainingPlan == null || !UIHelper.EnsurePremiumLicence())
            {
                return;
            }

            PublishWorkoutPlanWindow dlg = new PublishWorkoutPlanWindow();

            dlg.Fill(TrainingPlan, true);
            if (dlg.ShowDialog() == true)
            {
                WorkoutPlansReposidory.Instance.ClearCache();
                Fill(pageContext);
            }
        }
コード例 #2
0
        public static bool AddToFavorites(this TrainingPlan plan)
        {
            if (plan == null || plan.IsFavorite() || plan.IsMine())
            {
                return(false);
            }
            PublishWorkoutPlanWindow dlg = new PublishWorkoutPlanWindow();

            dlg.Fill(plan, false);
            if (dlg.ShowDialog() == false)
            {
                return(false);
            }
            WorkoutPlansReposidory.Instance.Add(plan);
            //WorkoutPlansReposidory.Instance.ClearCache();
            return(true);
        }