ArcGISPortalViewer.View.PortalCollectionPage.LoadState C# (CSharp) Method

LoadState() protected method

Populates the page with content passed during navigation. Any saved state is also provided when recreating a page from a prior session.
protected LoadState ( Object navigationParameter, Object>.Dictionary pageState ) : void
navigationParameter Object The parameter value passed to /// when this page was initially requested. ///
pageState Object>.Dictionary A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.
return void
        protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
        {
            if (navigationParameter == null)
                return;

            var collectionType = navigationParameter.GetType();
            if (collectionType == null)
                return;

            if (collectionType == typeof(IncremetalLoadingCollection))
                Messenger.Default.Send(new ChangeIncremetalCollectionMessage { ItemCollection = navigationParameter as IncremetalLoadingCollection });
            else if (collectionType == typeof(ObservableCollection<ArcGISPortalItem>))
                Messenger.Default.Send(new ChangeFavoritesCollectionMessage { ItemCollection = navigationParameter as ObservableCollection<ArcGISPortalItem>, Title = "Favorites" });
            else if (collectionType == typeof(PortalGroupCollection))
                Messenger.Default.Send(new ChangePortalGroupsCollectionMessage { ItemCollection = navigationParameter as ObservableCollection<ArcGISPortalGroup> });
            else if (collectionType == typeof(PortalItemCollection))
                Messenger.Default.Send(new ChangePortalItemsCollectionMessage { ItemCollection = navigationParameter as ObservableCollection<ArcGISPortalItem>, Title = "My Maps" });
        }