/// <summary> /// Populates the view ViewModel. /// </summary> /// <returns> /// </returns> public override void PopulateViewModel() { BaseCL.LogRoutineEntry("AddressDetailViewModel"); AddressObject = DV.AddressDV.GetModelFromHLink(BaseNavParamsHLink); if (AddressObject.Valid) { // Trigger refresh of View fields via INotifyPropertyChanged RaisePropertyChanged(string.Empty); BaseTitle = AddressObject.GetDefaultText; // Get media image MediaCard = AddressObject.HomeImageHLink.ConvertToHLinkMediaModel; // Get Header Details //CardGroup headerCardGroup = new CardGroup { }; // Get the Name Details CardListLineCollection nameDetails = new CardListLineCollection { new CardListLine("Card Type:", "Address Detail"), new CardListLine("Street:", AddressObject.GStreet), new CardListLine("City:", AddressObject.GCity), new CardListLine("Locality:", AddressObject.GLocality), new CardListLine("County:", AddressObject.GCounty), new CardListLine("State:", AddressObject.GState), new CardListLine("Country:", AddressObject.GCountry), new CardListLine("Date:", AddressObject.GDate.ShortDate), new CardListLine("Postal:", AddressObject.GPostal), new CardListLine("Phone:", AddressObject.GPhone), }; // Get date card BaseDetail.Add(AddressObject.GDate.AsCardListLine()); BaseDetail.Add(nameDetails); // Add Standard details BaseDetail.Add(DV.PersonDV.GetModelInfoFormatted(AddressObject)); // Add map card BaseDetail.Add(TurnAddressToURLModel()); // Add header //BaseDetail.Add(headerCardGroup); BaseDetail.Add(AddressObject.GCitationRefCollection.GetCardGroup()); BaseDetail.Add(AddressObject.GNoteRefCollection.GetCardGroup()); } return; }
/// <summary> /// Populates the view ViewModel. /// </summary> /// <returns> /// </returns> public override void PopulateViewModel() { BaseCL.LogRoutineEntry("AddressDetailViewModel"); AddressObject = DV.AddressDV.GetModelFromHLink(BaseNavParamsHLink); if (AddressObject.Valid) { BaseTitle = AddressObject.GetDefaultText; // Get media image HLinkHomeImageModel AddressImage = AddressObject.HomeImageHLink; AddressImage.CardType = DisplayFormat.MediaCardLarge; BaseDetail.Add(AddressImage); // Get Header Details CardGroup headerCardGroup = new CardGroup { Title = "Address Details" }; // Get the Name Details CardListLineCollection nameDetails = new CardListLineCollection { new CardListLine("Card Type:", "Address Detail"), new CardListLine("Street:", AddressObject.GStreet), new CardListLine("City:", AddressObject.GCity), new CardListLine("Locality:", AddressObject.GLocality), new CardListLine("County:", AddressObject.GCounty), new CardListLine("State:", AddressObject.GState), new CardListLine("Country:", AddressObject.GCountry), new CardListLine("Date:", AddressObject.GDate.ShortDate), new CardListLine("Postal:", AddressObject.GPostal), new CardListLine("Phone:", AddressObject.GPhone), }; headerCardGroup.Add(nameDetails); // Add Standard details headerCardGroup.Add(DV.PersonDV.GetModelInfoFormatted(AddressObject)); // Add map card headerCardGroup.Add(TurnAddressToURLModel()); // Add header BaseDetail.Add(headerCardGroup); BaseDetail.Add(AddressObject.GCitationRefCollection.GetCardGroup()); BaseDetail.Add(AddressObject.GNoteRefCollection.GetCardGroup()); BaseDetail.Add(AddressObject.BackHLinkReferenceCollection.GetCardGroup()); } return; }
/// <summary> /// Override for the OnNavigatedTo Prism method. /// </summary> public override void PopulateViewModel() { BaseCL.LogRoutineEntry("PeopleGraphViewModel"); string startPoint = BaseNavParamsHLinkDefault(new HLinkBase { HLinkKey = "_c47a6bd11500b4b0cc8" }).HLinkKey; // Assume person PersonModel t = DV.PersonDV.GetModelFromHLinkString(startPoint); if (t.HLink.Valid == true) { StartHLink = t.HLink; } else { FamilyModel tf = DV.FamilyDV.GetModelFromHLinkString(startPoint); StartHLink = tf.HLink; } if (!StartHLink.Valid) { DataStore.CN.NotifyError("HLink passed to PersonGraph not found"); return; } GraphReset(); GetGraph(); LayoutPreStart(); LayoutNodes(); LayoutEdges(); }
/// <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. /// /// XML 1.71 all done /// </summary> /// <returns> /// </returns> public override void PopulateViewModel() { BaseCL.LogRoutineEntry("NameDetailViewModel"); PersonNameObject = DV.PersonNameDV.GetModelFromHLink(BaseNavParamsHLink); if (PersonNameObject.Valid) { BaseTitle = PersonNameObject.GetDefaultText; // Get media image HLinkHomeImageModel AddressImage = PersonNameObject.HomeImageHLink; AddressImage.CardType = DisplayFormat.MediaCardLarge; BaseDetail.Add(AddressImage); // Get Header Details CardGroup headerCardGroup = new CardGroup { Title = "Person Name Details" }; BaseDetail.Add(headerCardGroup); // TODO Show All Surnames CardListLineCollection PersonNameCards = new CardListLineCollection { new CardListLine("Type:", PersonNameObject.GType), new CardListLine("Full Name:", PersonNameObject.FullName), new CardListLine("Title:", PersonNameObject.GTitle), new CardListLine("FirstName:", PersonNameObject.GFirstName), new CardListLine("SurName:", PersonNameObject.GSurName.GetPrimarySurname), new CardListLine("Suffix:", PersonNameObject.GSuffix), new CardListLine("Alt:", PersonNameObject.GAlt.GetDefaultText), new CardListLine("Call:", PersonNameObject.GCall), new CardListLine("Date:", PersonNameObject.GDate.ShortDate), new CardListLine("Display:", PersonNameObject.GDisplay), new CardListLine("Family Nick:", PersonNameObject.GFamilyNick), new CardListLine("Group:", PersonNameObject.GGroup), new CardListLine("Nick:", PersonNameObject.GNick), new CardListLine("Priv:", PersonNameObject.GPriv), new CardListLine("Sort:", PersonNameObject.GSort) }; BaseDetail.Add(PersonNameCards); foreach (SurnameModel item in PersonNameObject.GSurName) { CardListLineCollection SurnameCard = new CardListLineCollection { new CardListLine("Prefix:", item.GPrefix), new CardListLine("Primary:", item.GPrim), new CardListLine("Derivation:", item.GDerivation), new CardListLine("Connector:", item.GConnector), }; BaseDetail.Add(SurnameCard); } BaseDetail.Add(PersonNameObject.GCitationRefCollection.GetCardGroup()); BaseDetail.Add(PersonNameObject.GNoteReferenceCollection.GetCardGroup()); BaseDetail.Add(PersonNameObject.BackHLinkReferenceCollection.GetCardGroup()); } return; }
/// <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> /// Handles navigation in wards and sets up the event model parameter. /// </summary> /// <returns> /// </returns> public override void PopulateViewModel() { BaseCL.LogRoutineEntry("MediaDetailViewModel OnNavigatedTo"); CurrentHLinkMedia = BaseNavParamsHLink as HLinkMediaModel; if (!(CurrentHLinkMedia is null)) { CurrentMediaObject = DV.MediaDV.GetModelFromHLink(CurrentHLinkMedia); if (!(CurrentMediaObject is null)) { BaseTitle = CurrentMediaObject.GetDefaultText; BaseTitleIcon = CommonConstants.IconMedia; // Get basic details CardGroup t = new CardGroup { Title = "Header Details" }; t.Add(new CardListLineCollection { new CardListLine("Card Type:", "Media Detail"), new CardListLine("Date:", CurrentMediaObject.GDateValue.GetLongDateAsString), new CardListLine("File Description:", CurrentMediaObject.GDescription), new CardListLine("File Mime Type:", CurrentMediaObject.FileMimeType), new CardListLine("File Content Type:", CurrentMediaObject.FileContentType), new CardListLine("File Mime SubType:", CurrentMediaObject.FileMimeSubType), new CardListLine("OriginalFilePath:", CurrentMediaObject.OriginalFilePath), }); // Set up note re opening in photo app CardListLineCollection t1 = new CardListLineCollection { new CardListLine(string.Empty, "Note: Double click the image to open it.") }; t.Add(t1); // Add standard details t.Add(DV.MediaDV.GetModelInfoFormatted(CurrentMediaObject)); BaseDetail.Add(t); // Get media image HLinkHomeImageModel personImage = CurrentMediaObject.HomeImageHLink; Contract.Assert(CurrentMediaObject.HomeImageHLink != null, CurrentMediaObject.Id); personImage.CardType = DisplayFormat.MediaCardLarge; BaseDetail.Add(personImage); // Add HLink Details BaseDetail.Add(CurrentHLinkMedia.GAttributeRefCollection); BaseDetail.Add(CurrentHLinkMedia.GCitationRefCollection.GetCardGroup("HLink Citations")); BaseDetail.Add(CurrentHLinkMedia.GNoteRefCollection.GetCardGroup("HLink Notes")); // Add Model details BaseDetail.Add(CurrentMediaObject.GCitationRefCollection.GetCardGroup()); BaseDetail.Add(CurrentMediaObject.GNoteRefCollection.GetCardGroup()); BaseDetail.Add(CurrentMediaObject.GTagRefCollection.GetCardGroup()); BaseDetail.Add(CurrentMediaObject.BackHLinkReferenceCollection.GetCardGroup()); } BaseCL.LogRoutineExit("MediaDetailViewModel OnNavigatedTo"); } }
/// <summary> /// Populates the view ViewModel. /// /// XML 1.71 all done /// </summary> /// <returns> /// </returns> public override void PopulateViewModel() { BaseCL.LogRoutineEntry("NameDetailViewModel"); PersonNameObject = DV.PersonNameDV.GetModelFromHLink(BaseNavParamsHLink); if (PersonNameObject.Valid) { BaseTitle = PersonNameObject.GetDefaultText; // Trigger refresh of View fields via INotifyPropertyChanged RaisePropertyChanged(string.Empty); // Get media image MediaCard = PersonNameObject.HomeImageHLink.ConvertToHLinkMediaModel; // Get Header Details CardGroup headerCardGroup = new CardGroup { Title = "Person Name Details" }; BaseDetail.Add(headerCardGroup); // TODO Show All Surnames CardListLineCollection PersonNameCards = new CardListLineCollection { new CardListLine("Type:", PersonNameObject.GType), new CardListLine("Full Name:", PersonNameObject.FullName), new CardListLine("Title:", PersonNameObject.GTitle), new CardListLine("FirstName:", PersonNameObject.GFirstName), new CardListLine("SurName:", PersonNameObject.GSurName.GetPrimarySurname), new CardListLine("Suffix:", PersonNameObject.GSuffix), new CardListLine("Alt:", PersonNameObject.GAlt.GetDefaultText), new CardListLine("Call:", PersonNameObject.GCall), new CardListLine("Display:", PersonNameObject.GDisplay), new CardListLine("Family Nick:", PersonNameObject.GFamilyNick), new CardListLine("Group:", PersonNameObject.GGroup), new CardListLine("Nick:", PersonNameObject.GNick), new CardListLine("Priv:", PersonNameObject.GPriv), new CardListLine("Sort:", PersonNameObject.GSort) }; BaseDetail.Add(PersonNameCards); // Get date card BaseDetail.Add(PersonNameObject.GDate.AsCardListLine()); foreach (SurnameModel item in PersonNameObject.GSurName) { CardListLineCollection SurnameCard = new CardListLineCollection { new CardListLine("Prefix:", item.GPrefix), new CardListLine("Primary:", item.GPrim), new CardListLine("Derivation:", item.GDerivation), new CardListLine("Connector:", item.GConnector), }; BaseDetail.Add(SurnameCard); } BaseDetail.Add(PersonNameObject.GCitationRefCollection.GetCardGroup()); BaseDetail.Add(PersonNameObject.GNoteReferenceCollection.GetCardGroup()); BaseDetail.Add(PersonNameObject.BackHLinkReferenceCollection.GetCardGroup()); } return; }
/// <summary> /// Populates the view ViewModel. /// </summary> /// <returns> /// </returns> public override async Task <bool> PopulateViewModelAsync() { BaseCL.LogRoutineEntry("PersonDetailViewModel"); PersonObject = DV.PersonDV.GetModelFromHLink(BaseNavParamsHLink); if (!(PersonObject is null)) { BaseTitle = PersonObject.GPersonNamesCollection.GetPrimaryName.GetDefaultText; // Get media image HLinkHomeImageModel personImage = PersonObject.HomeImageHLink; 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 Name Details CardListLineCollection nameDetails = new CardListLineCollection { new CardListLine("Card Type:", "Person Detail"), }; headerCardGroup.Add(nameDetails); // Handle the common case where there is only one name if (PersonObject.GPersonNamesCollection.Count == 1) { headerCardGroup.Add(PersonObject.GPersonNamesCollection[0]); } // Get extra details CardListLineCollection extraDetailsCard = new CardListLineCollection { new CardListLine("Gender:", PersonObject.GGenderAsString), }; if (PersonObject.BirthDate != null) { extraDetailsCard.Add(new CardListLine("Birth Date:", PersonObject.BirthDate.GetLongDateAsString)); if (PersonObject.IsLiving) { extraDetailsCard.Add(new CardListLine("Age:", PersonObject.BirthDate.GetAge)); } else { extraDetailsCard.Add(new CardListLine("Years Since Birth:", PersonObject.BirthDate.GetAge)); EventModel ageAtDeath = DV.EventDV.GetEventType(PersonObject.GEventRefCollection, "Death"); if (ageAtDeath.Valid) { extraDetailsCard.Add(new CardListLine("Age at Death:", ageAtDeath.GDate.DateDifferenceDecoded(PersonObject.BirthDate))); } } } else { extraDetailsCard.Add(new CardListLine("Birth Date:", "Unknown")); } extraDetailsCard.Add(new CardListLine("Is Living:", PersonObject.IsLivingAsString)); headerCardGroup.Add(extraDetailsCard); // Get parent details headerCardGroup.Add( new ParentLinkModel { Parents = PersonObject.GChildOf.DeRef, }); // Add Standard details headerCardGroup.Add(DV.PersonDV.GetModelInfoFormatted(PersonObject)); BaseDetail.Add(headerCardGroup); // Handle the uncommon case where there is more than one name if (PersonObject.GPersonNamesCollection.Count > 1) { // Add extra name details BaseDetail.Add(PersonObject.GPersonNamesCollection.GetCardGroup1()); } // Get Bio HLinkNoteModel bioCard = PersonObject.GNoteRefCollection.GetBio; bioCard.CardType = DisplayFormat.NoteCardFull; BaseDetail.Add(bioCard); // Add details BaseDetail.Add(PersonObject.GParentInRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GEventRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GCitationRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GNoteRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GMediaRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GAttributeCollection); BaseDetail.Add(PersonObject.GAddress); BaseDetail.Add(PersonObject.GTagRefCollection.GetCardGroup()); BaseDetail.Add(PersonObject.GURLCollection); BaseDetail.Add(PersonObject.GLDSCollection); BaseDetail.Add(PersonObject.GPersonRefCollection); BaseDetail.Add(PersonObject.GPersonNamesCollection.GetPrimaryName.GCitationRefCollection.GetCardGroup("Name Citations")); BaseDetail.Add(PersonObject.GPersonNamesCollection.GetPrimaryName.GNoteReferenceCollection.GetCardGroup("Name Notes")); BaseDetail.Add(PersonObject.BackHLinkReferenceCollection.GetCardGroup()); // TODO localActivitySession = await CommonTimeline.AddToTimeLine("Person", // PersonObject, PersonObject.HomeImageHLink.DeRef.MediaStorageFilePath, "Person: " // + PersonObject.BirthName.FullName, "Born: " + PersonObject.BirthDate.GetShortDateAsString).ConfigureAwait(false); } return(true); }