/// <summary> /// If completed event, this shows the StudyViewModel populated with the produced IViewModelBase /// produced by the study partner. /// </summary> /// <param name="message"></param> public void Handle(IStatusUpdate <MultiLineTextList, IViewModelBase> message) { //WE ONLY CARE ABOUT STUDY UPDATES if (message.Category != StudyResources.CategoryStudy) { return; } //WE DON'T CARE ABOUT MESSAGES WE PUBLISH OURSELVES if (message.PublisherId == Id) { return; } //WE ONLY CARE ABOUT UPDATES TO OUR CURRENT OPPORTUNITIES if (message.Opportunity == null || !CurrentOpportunities.Contains(message.Opportunity)) { return; } //THIS IS ONE OF THIS OBJECT'S UPDATES //IF THIS IS A COMPLETED STATUS UPDATE, THEN PRODUCT SHOULD BE SET. SO, BUBBLE THIS ASPECT UP. if (message.Status == CommonResources.StatusCompleted) { if (message.JobInfo.Product == null) { throw new StudyException("StatusCompleted posted but JobInfo.Product == null...Where is the product?"); } //WE HAVE A PRODUCT OF TYPE IVIEWMODELBASE THAT HAS BEEN CREATED FOR US VIA //THE EXCHANGE! var productViewModel = message.JobInfo.Product; //MOVE THE OPPORTUNITY TO PAST OPPORTUNITIES CurrentOpportunities.Remove(message.Opportunity); PastOpportunities.Add(message.Opportunity); //LET HISTORY KNOW WE ARE DONE THINKING OF THIS OPPORTUNITY var targetId = message.Opportunity.Id; History.Events.ThinkingAboutTargetEvent.Publish(System.Guid.Empty); ////GET THE STUDY VIEWMODEL THAT WILL HOUSE OUR CREATED IVIEWMODELBASE var studyViewModel = Services.Container.GetExportedValue <ExecuteStudySongsViewModel>(); studyViewModel.StudyScreen = productViewModel; //NAVIGATE TO THE EXECUTE STUDY SONGS PAGE TO BEGIN STUDYING var executeStudySongsPage = Services.Container.GetExportedValue <ExecuteStudySongsPage>(); Navigation.Navigator.Ton.NavigateTo(executeStudySongsPage); } }