public override void PopulateViewModel() { CardGroup tt = new CardGroup(); InstructionCardLarge instructionCard = new InstructionCardLarge { BindingContext = AppResources.SearchPage_Instructions, }; tt.Add(instructionCard); BaseDetail.Add(tt); }
/// <summary> /// Processes the query. /// </summary> /// <param name="argSearch"> /// Search Text. /// </param> /// <param name="argLimit"> /// Search Limit for search terms found while typing. /// </param> public void ProcessQuery(string argSearch, int argLimit) { SearchText = argSearch; //SearchNothingFound = false; BaseDetail.Clear(); CardGroup SearchCards; if (SearchText.Length > 0) { // Create Person Cards SearchCards = new CardGroup { Title = "People" }; foreach (SearchItem item in DV.PersonDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); // Create Person Name Cards SearchCards = new CardGroup { Title = "Person Names" }; foreach (SearchItem item in DV.PersonNameDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); // Create Family Cards SearchCards = new CardGroup { Title = "Families" }; foreach (SearchItem item in DV.FamilyDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); // Create Event Cards SearchCards = new CardGroup { Title = "Events" }; foreach (SearchItem item in DV.EventDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); // Create Note cards SearchCards = new CardGroup { Title = "Notes" }; foreach (SearchItem item in DV.NoteDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); // Create Address Cards SearchCards = new CardGroup { Title = "Addresses" }; foreach (SearchItem item in DV.AddressDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); // Create Citation cards SearchCards = new CardGroup { Title = "Citations" }; foreach (SearchItem item in DV.CitationDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); // Create Media Cards SearchCards = new CardGroup { Title = "Media" }; foreach (SearchItem item in DV.MediaDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); // Create Place Cards SearchCards = new CardGroup { Title = "Places" }; foreach (SearchItem item in DV.PlaceDV.Search(SearchText)) { if (SearchCards.Count < argLimit) { SearchCards.Add(item.HLink); } } BaseDetail.Add(SearchCards); } if (BaseDetail.Count == 0) { CardGroup tt = new CardGroup(); InstructionCardLarge instructionCard = new InstructionCardLarge { BindingContext = AppResources.SearchPage_NothingFound, }; tt.Add(instructionCard); BaseDetail.Add(tt); } }
/// <summary> /// Populate the Hub View. /// </summary> public override void PopulateViewModel() { CardGroup tt = new CardGroup(); InstructionCardLarge instructionCard = new InstructionCardLarge { BindingContext = AppResources.HubPage_IntroductionText, }; tt.Add(instructionCard); BaseDetail.Add(tt); // Get Header CardLarge HLinkHeaderModel HeaderCard = DV.HeaderDV.HeaderDataModel.HLink; HeaderCard.CardType = DisplayFormat.HeaderCardLarge; BaseDetail.Add(HeaderCard); IHLinkMediaModel HeroImage = DV.MediaDV.GetRandomFromCollection(null); HeroImage.CardType = DisplayFormat.MediaCardLarge; BaseDetail.Add(HeroImage); if (HeroImage == null) { DataStore.CN.NotifyAlert("No images found in this data. Consider adding some."); } // Setup ToDo list ObservableCollection <INoteModel> t = DV.NoteDV.GetAllOfType(NoteModel.GTypeToDo); CardGroup toDoCardGroup = new CardGroup { Title = "ToDo list" }; foreach (NoteModel item in t) { toDoCardGroup.Add(item.HLink); } BaseDetail.Add(toDoCardGroup); // Setup Latest Changes list // TODO fix this LatestChanges.Add(DV.BookMarkDV.GetLatestChanges()); BaseDetail.Add(DV.CitationDV.GetLatestChanges()); BaseDetail.Add(DV.EventDV.GetLatestChanges()); BaseDetail.Add(DV.FamilyDV.GetLatestChanges()); BaseDetail.Add(DV.MediaDV.GetLatestChanges()); BaseDetail.Add(DV.NoteDV.GetLatestChanges()); BaseDetail.Add(DV.PersonDV.GetLatestChanges()); BaseDetail.Add(DV.PlaceDV.GetLatestChanges()); BaseDetail.Add(DV.SourceDV.GetLatestChanges()); BaseDetail.Add(DV.TagDV.GetLatestChanges()); return; }