public void InitialHomePageItemsLoad()
 {
     if (PBData.GetSecureItemCountByType(SecurityItemsDefaultProperties.SecurityItemType_PasswordVault) != 0)
     {
         LoadFavoriteItems();
     }
     else
     {
         LoadRecommendedSites();
     }
 }
        public void LoadHomepageItemList()
        {
            HomepageItemList.Clear();
            if (PBData.GetSecureItemCountByType(SecurityItemsDefaultProperties.SecurityItemType_PasswordVault) != 0)
            {
                HomepageItem favoriteSites = new HomepageItem(this);
                favoriteSites.Name = System.Windows.Application.Current.FindResource("SecureBrowserFavoriteSites") as string;
                favoriteSites.Key  = HomepageItem.FAVORITE_ITEM;

                HomepageItem recentlyUsed = new HomepageItem(this);
                recentlyUsed.Name = System.Windows.Application.Current.FindResource("SecureBrowserRecentlyUsed") as string;
                recentlyUsed.Key  = HomepageItem.RECENTLY_USED_ITEM;

                HomepageItem mostUsed = new HomepageItem(this);
                mostUsed.Name = System.Windows.Application.Current.FindResource("SecureBrowserMostUsed") as string;
                mostUsed.Key  = HomepageItem.MOST_USED_ITEM;

                HomepageItemList.Add(favoriteSites);
                HomepageItemList.Add(recentlyUsed);
                HomepageItemList.Add(mostUsed);

                var lastViewKey = PBData.GetPrivateSetting(HomepageItem.SB_LAST_VIEW_KEY);
                if (lastViewKey == null)
                {
                    SelectedHomepageItem = recentlyUsed;
                }
                else
                {
                    SelectedHomepageItem = HomepageItemList.Where(x => x.Key == lastViewKey).FirstOrDefault();
                    if (SelectedHomepageItem == null)
                    {
                        SelectedHomepageItem = recentlyUsed;
                    }
                }
            }


            //LoadFavoriteItems();


            //var favoriteSecureItemsList = PBData.GetSecureItemsByItemType(DefaultProperties.SecurityItemType_PasswordVault);
            //HomepageFavoriteItems.Clear();

            //foreach(var favoriteItem in favoriteSecureItemsList)
            //{
            //    HomepageFavoriteItems.Add(new SecureBrowserItem(favoriteItem));
            //}
            //HomepageFavoriteModel.CreatePaging();

            //var recentlyUsedItemList = PBData.GetSecureItemsByItemType(DefaultProperties.SecurityItemType_PasswordVault, SecureItemOrderEnum.LastAccess);
            //HomepageRecentlyUsedItems.Clear();

            //foreach (var item in recentlyUsedItemList)
            //{
            //    HomepageRecentlyUsedItems.Add(new SecureBrowserItem(item));
            //}
            //HomepageRecentlyUsedModel.CreatePaging();

            //var mostUsedItemList = PBData.GetSecureItemsByItemType(DefaultProperties.SecurityItemType_PasswordVault, SecureItemOrderEnum.AccessCount);
            //HomepageMostUsedItems.Clear();

            //foreach (var item in mostUsedItemList)
            //{
            //    HomepageMostUsedItems.Add(new SecureBrowserItem(item));
            //}
            //HomepageMostUsedModel.CreatePaging();
        }