private void _commentExecute(object parameter) { if (_eventService.AddComment(SystemUser.Instance.Id, _event.Id, CommentText)) { CommentText = ""; Comments = _eventService.GetComments(_event.Id).ToList(); } }
public EventViewModel(Guid eventId) { _eventService = new EventServiceClient(); Event = _eventService.GetById(eventId); Comments = _eventService.GetComments(eventId).ToList(); Participants = _eventService.GetParticipants(eventId).ToList(); Comment = new BaseCommand(_commentExecute, _commentCanExecute); Subscribe = new BaseCommand(_subscribeExecute, _subscribeCanExecute); if (Participants.Any(u => u.Id == SystemUser.Instance.Id)) { SubscribeBtnText = "UnSubscribe"; } else { SubscribeBtnText = "Subscribe"; } }