public override void NotifyPropertiesChanged()
        {
            base.NotifyPropertiesChanged();

            CurrentMembership?.LocalRefresh();

            if (CurrentMembership?.OngoingChallenge == null)
            {
                OngoingChallengeViewModel = null;
            }

            if (CurrentMembership?.OngoingChallenge != null)
            {
                if (OngoingChallengeViewModel == null)
                {
                    OngoingChallengeViewModel = new ChallengeDetailsViewModel();
                }

                OngoingChallengeViewModel.Challenge = CurrentMembership.OngoingChallenge;
            }

            SetPropertyChanged("OngoingChallengeViewModel");
            SetPropertyChanged("PreviousChallengeViewModel");

            MembershipViewModel?.NotifyPropertiesChanged();
            OngoingChallengeViewModel?.NotifyPropertiesChanged();
        }
Beispiel #2
0
        public override void NotifyPropertiesChanged([CallerMemberName] string caller = "")
        {
            Debug.WriteLine($"Notify called for League - {League?.Name} by {caller}");
            base.NotifyPropertiesChanged();

            App.Instance.CurrentAthlete.LocalRefresh();
            League.LocalRefresh();

            CurrentMembership?.LocalRefresh();
            SetPropertyChanged("CurrentMembership");

            if (CurrentMembership?.OngoingChallenges == null)
            {
                OngoingChallengeViewModels = new ObservableCollection <ChallengeDetailsViewModel>();
            }
            else if (CurrentMembership?.OngoingChallenges != null)
            {
                SetOngoingChallenges();
            }
            else
            {
                SetPropertyChanged("OngoingChallengeViewModels");
                OngoingChallengeViewModels.ForEach(vm => vm.NotifyPropertiesChanged());
            }

            MembershipViewModel?.NotifyPropertiesChanged();
        }