/// <summary> /// Populates the view ViewModel. /// </summary> /// <returns> /// </returns> public override void PopulateViewModel() { BaseCL.LogRoutineEntry("PersonDetailViewModel"); PersonObject = DV.PersonDV.GetModelFromHLink(BaseNavParamsHLink); if (!(PersonObject is null)) { BaseTitle = PersonObject.GPersonNamesCollection.GetPrimaryName.DeRef.GetDefaultText; // Get media image HLinkMediaModel personImage = PersonObject.HomeImageHLink.ConvertToHLinkMediaModel(); Contract.Assert(PersonObject.HomeImageHLink != null, PersonObject.Id); personImage.CardType = DisplayFormat.MediaCardLarge; BaseDetail.Add(personImage); // Get Header Details CardGroup headerCardGroup = new CardGroup { Title = "Header Details" }; // Get the Person Details CardListLineCollection nameDetails = new CardListLineCollection { new CardListLine("Card Type:", "Person Detail"), }; headerCardGroup.Add(nameDetails); // Get the Name Details headerCardGroup.Add(PersonObject.GPersonNamesCollection.GetPrimaryName); // Get details on persons age etc headerCardGroup.Add(GetExtraPersonDetails()); // Get parent details headerCardGroup.Add( new ParentLinkModel { Parents = PersonObject.GChildOf.DeRef, }); // Add Standard details headerCardGroup.Add(DV.PersonDV.GetModelInfoFormatted(PersonObject)); BaseDetail.Add(headerCardGroup); // Get Bio HLinkNoteModel bioCard = PersonObject.GNoteRefCollection.GetBio; bioCard.CardType = DisplayFormat.NoteCardFull; BaseDetail.Add(bioCard); // Add PersonRefDetails if (BaseNavParamsHLink is HLinkPersonRefModel) { HLinkPersonRefModel personRef = (BaseNavParamsHLink as HLinkPersonRefModel); Contract.Assert(personRef != null); BaseDetail.Add(personRef.GCitationCollection.GetCardGroup("PersonRef Citations")); BaseDetail.Add(personRef.GNoteCollection.GetCardGroup("PersonRef Notes")); } // Add details BaseDetail.Add(PersonObject.GPersonNamesCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GParentInRefCollection.GetCardGroup()); BaseDetail.Add(EventsIncFamily()); BaseDetail.Add(PersonObject.GCitationRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GNoteRefCollection.GetCardGroupWithoutBio()); BaseDetail.Add(PersonObject.GMediaRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GAttributeCollection); BaseDetail.Add(PersonObject.GAddress.GetCardGroup()); BaseDetail.Add(PersonObject.GTagRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GURLCollection); BaseDetail.Add(PersonObject.GLDSCollection); BaseDetail.Add(PersonObject.GPersonRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.BackHLinkReferenceCollection.GetCardGroup()); _PlatformSpecific.ActivityTimeLineAdd(PersonObject); } return; }
/// <summary> /// Populates the view ViewModel. /// </summary> /// <returns> /// </returns> public override void PopulateViewModel() { BaseCL.LogRoutineEntry("PersonDetailViewModel"); PersonObject = DV.PersonDV.GetModelFromHLink(BaseNavParamsHLink); // Trigger refresh of View fields via INotifyPropertyChanged RaisePropertyChanged(string.Empty); if (!(PersonObject is null)) { BaseTitle = PersonObject.GPersonNamesCollection.GetPrimaryName.DeRef.GetDefaultText; // Get media image MediaCard = PersonObject.HomeImageHLink.ConvertToHLinkMediaModel; // Get Header Details //CardGroup headerCardGroup = new CardGroup { Title = "Header Details" }; // Get the Person Details CardListLineCollection nameDetails = new CardListLineCollection { new CardListLine("Card Type:", "Person Detail"), }; BaseDetail.Add(nameDetails); // Get the Name Details BaseDetail.Add(PersonObject.GPersonNamesCollection.GetPrimaryName.Copy(), argDisplayFormat: DisplayFormat.PersonNameCardSingle); // Get date card BaseDetail.Add(PersonObject.BirthDate.AsCardListLine("Birth Date")); // Get details on persons age etc BaseDetail.Add(GetExtraPersonDetails()); // Get parent details BaseDetail.Add( new ParentLinkModel { Parents = PersonObject.GChildOf.DeRef, }); // Add Standard details BaseDetail.Add(DV.PersonDV.GetModelInfoFormatted(PersonObject)); // BaseDetail.Add(headerCardGroup); // Get Bio HLinkNoteModel bioCard = PersonObject.GNoteRefCollection.GetBio; if (bioCard.Valid) { bioCard.CardType = DisplayFormat.NoteCardFull; BaseDetail.Add(bioCard); } // Add PersonRefDetails if (BaseNavParamsHLink is HLinkPersonRefModel) { HLinkPersonRefModel personRef = (BaseNavParamsHLink as HLinkPersonRefModel); Contract.Assert(personRef != null); BaseDetail.Add(personRef.GCitationCollection.GetCardGroup("PersonRef Citations")); BaseDetail.Add(personRef.GNoteCollection.GetCardGroup("PersonRef Notes")); } // Add details //BaseDetail.Add(PersonObject.GPersonNamesCollection.GetCardGroup()); //BaseDetail.Add(PersonObject.GParentInRefCollection.GetCardGroup()); //BaseDetail.Add(EventsIncFamily()); //BaseDetail.Add(PersonObject.GCitationRefCollection.GetCardGroup()); //BaseDetail.Add(PersonObject.GNoteRefCollection.GetCardGroupWithoutBio()); //BaseDetail.Add(PersonObject.GMediaRefCollection.GetCardGroup()); //BaseDetail.Add(PersonObject.GAttributeCollection); //BaseDetail.Add(PersonObject.GAddress.GetCardGroup()); //BaseDetail.Add(PersonObject.GTagRefCollection.GetCardGroup()); //BaseDetail.Add(PersonObject.GURLCollection); //BaseDetail.Add(PersonObject.GLDSCollection); //BaseDetail.Add(PersonObject.GPersonRefCollection.GetCardGroup()); _PlatformSpecific.ActivityTimeLineAdd(PersonObject); } return; }
/// <summary> /// Populates the view ViewModel. /// </summary> /// <returns> /// Task. /// </returns> public override void PopulateViewModel() { FamilyObject = DV.FamilyDV.GetModelFromHLink(BaseNavParamsHLink); if (!(FamilyObject is null)) { BaseTitle = FamilyObject.FamilyDisplayName; BaseTitleIcon = CommonConstants.IconFamilies; // Trigger refresh of View fields via INotifyPropertyChanged RaisePropertyChanged(string.Empty); // Get basic details //CardGroup t = new CardGroup { Title = "Header Details" }; BaseDetail.Add(new CardListLineCollection { new CardListLine("Card Type:", "Family Detail"), new CardListLine("Family Display Name:", FamilyObject.FamilyDisplayName), new CardListLine("Family Relationship:", FamilyObject.GFamilyRelationship), new CardListLine("Father Name:", FamilyObject.GFather.DeRef.GPersonNamesCollection.GetPrimaryName.DeRef.FullName), new CardListLine("Mother Name:", FamilyObject.GMother.DeRef.GPersonNamesCollection.GetPrimaryName.DeRef.FullName), }); // Add Model details BaseDetail.Add(DV.FamilyDV.GetModelInfoFormatted(FamilyObject)); // Add parent link BaseDetail.Add(new ParentLinkModel { Parents = localFamilyModel, }); //BaseDetail.Add(t); // Detail reference //BaseDetail.Add(FamilyObject.GEventRefCollection.GetCardGroup()); //BaseDetail.Add(FamilyObject.GChildRefCollection.GetCardGroup()); // TODO , "Children"); //BaseDetail.Add(FamilyObject.GCitationRefCollection.GetCardGroup()); //BaseDetail.Add(FamilyObject.GMediaRefCollection.GetCardGroup()); //BaseDetail.Add(FamilyObject.GNoteRefCollection.GetCardGroup()); //BaseDetail.Add(FamilyObject.GAttributeCollection); //BaseDetail.Add(FamilyObject.GTagRefCollection.GetCardGroup()); string outFamEvent; if (FamilyObject.GEventRefCollection.Count > 0) { // TODO Handle this outFamEvent = FamilyObject.GEventRefCollection.FirstOrDefault().DeRef.GType + ": " + FamilyObject.GEventRefCollection.FirstOrDefault().DeRef.GDate.ShortDate; } // TODO localActivitySession = await CommonTimeline.AddToTimeLine("Family", // localFamilyModel, localFamilyModel.HomeImageHLink.DeRef.MediaStorageFilePath, // "Family: " + localFamilyModel.FamilyDisplayName, outFamEvent).ConfigureAwait(false); // TODO //CommonTimeline.FinishActivitySessionAsync(localActivitySession); } _PlatformSpecific.ActivityTimeLineAdd(FamilyObject); } }