private async void PopulatePortalItemCollection(ObservableCollection <ArcGISPortalItem> portalCollection, PortalQuery portalQuery)
        {
            if (portalCollection == null || portalQuery == PortalQuery.MyGroups)
            {
                return;
            }

            FavoritesService currentFavoritesService = new FavoritesService();
            await currentFavoritesService.SetFavoritesCollection();

            SearchParameters sp = null;

            if (portalQuery == PortalQuery.Favorites)
            {
                sp = SearchService.CreateSearchParameters("", portalQuery, 0, 20, currentFavoritesService.GetFavoritesIds());
            }
            else
            {
                sp = SearchService.CreateSearchParameters("", portalQuery);
            }

            IsLoadingData = true;
            IList <ArcGISPortalItem> portalItems = await PortalService.CurrentPortalService.GetPortalItems(sp);

            if (portalItems != null)
            {
                portalCollection.Clear();

                foreach (ArcGISPortalItem pi in portalItems)
                {
                    portalCollection.Add(pi);
                }
            }
            IsLoadingData = false;
        }