Ejemplo n.º 1
0
        public async Task LoadProcessedData()
        {
            ResourceLoader resourceLoader = new ResourceLoader();
            await ProcessData.LoadSettings();

            MembersHubViewModel OfficeMembers = new MembersHubViewModel();
            OfficeMembers.HubName = resourceLoader.GetString(OFFICE_RESOURCE_KEY);
            List<OfficeMember> OfficeMembersModelsList = ProcessData.GetOfficeMembers();

            foreach (OfficeMember officeMemberModel in OfficeMembersModelsList)
            {
                MemberItemViewModel officeMemberItem = new MemberItemViewModel();
                officeMemberItem.ModelToItem(officeMemberModel);
                OfficeMembers.Add(officeMemberItem);
            }
            this.Hubs.Add(OfficeMembers);

            MembersHubViewModel Members = new MembersHubViewModel();
            Members.HubName = resourceLoader.GetString(MEMBERS_RESOURCE_KEY);
            List<Member> MembersModelsList = ProcessData.GetMembers();

            foreach (Member MemberModel in MembersModelsList)
            {
                MemberItemViewModel MemberItem = new MemberItemViewModel();
                MemberItem.ModelToItem(MemberModel);
                Members.Add(MemberItem);
            }
            this.Hubs.Add(Members);
        }
Ejemplo n.º 2
0
 public void LoadSampleData()
 {
     string[] tempHubNames = { "Office", "Members" };
     for (int i = 0; i < 2; i++)
     {
         MembersHubViewModel tempHub = new MembersHubViewModel();
         tempHub.HubName = tempHubNames[i];
         for (int j = 0; j < 4; j++)
         {
             MemberItemViewModel tempItem = new MemberItemViewModel();
             tempItem.Image = "/Content/Images/Members/default.png";
             tempItem.Title = "John Doe " + j;
             tempItem.Subtitle = " Joined on 22/12/2012";
             tempHub.Add(tempItem);
         }
         this.Hubs.Add(tempHub);
     }
 }
Ejemplo n.º 3
0
 public void GetItemToScrollTo(MainItemViewModel item)
 {
     foreach (MembersHubViewModel membersHub in Hubs)
     {
         foreach (MemberItemViewModel member in membersHub)
         {
             if (item.Title.Equals(member.Title) && item.Subtitle.Equals(member.Subtitle))
             {
                 this.ItemToScrollTo = member;
             }
         }
     }
 }