private async Task ProcessCheckOut() { var reviews = _presentationDataService.GetContentReviews(); if (reviews.Any()) { IsContactsListVisible = false; if (IsChooseAtCheckOutFlow) { IsChooseAtCheckOutVisible = false; } if (ContentsReviews != null) { ContentsReviews.CollectionChanged -= OnContentsReviewsCollectionChanged; } ContentsReviews = new ObservableCollection <ContentReviewViewModel>(reviews.Select(cri => new ContentReviewViewModel(cri))); ContentsReviews.CollectionChanged += OnContentsReviewsCollectionChanged; ContentsReviews.ForEach(cr => cr.PropertyChanged += (s, e) => { GoToChooseContactCommand.RaiseCanExecuteChanged(); FinishCheckOutCommand.RaiseCanExecuteChanged(); }); GoToChooseContactCommand.RaiseCanExecuteChanged(); FinishCheckOutCommand.RaiseCanExecuteChanged(); } else { ResetState(); await _presentationDataService.FinishPresentation(string.Empty, new List <ContentReviewInfo>()); Messenger.Default.Send(new CheckInOutChangedMessage()); } }
private void OnContentsReviewsCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { FinishCheckOutCommand.RaiseCanExecuteChanged(); }