示例#1
0
        public async void UnSubParticipant(object parameter)
        {
            await RegiSing.RemoveRegistration(ShownEvent, (Participant)parameter);

            IsSubed = Participants.Contains(ViewModel.IsParticipant);
            ChangeSubButton();
            OnPropertyChanged(nameof(RemainingSpots));
            OnPropertyChanged(nameof(TakenSpots));
        }
示例#2
0
        public async void Subscribe()
        {
            if (!_isWorking && ShownEvent.MaxNoParticipant > Participants.Count)
            {
                _isWorking = true;
                if (IsSubed)
                {
                    await RegiSing.RemoveRegistration(ShownEvent, ViewModel.IsParticipant);
                }
                else
                {
                    await RegiSing.AddRegistration(ShownEvent, ViewModel.IsParticipant);
                }

                IsSubed = !IsSubed;
                ChangeSubButton();
                OnPropertyChanged(nameof(RemainingSpots));
                OnPropertyChanged(nameof(TakenSpots));
                _isWorking = false;
            }
        }