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); } }
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); }