Navigate() public method

Navigates to a panel. If a panel already exist with the same panelId instead or creating a new panel the old panel will be shown and passed the new arguments.
public Navigate ( Type panelType, string panelId, object>.Dictionary arguments = null ) : bool
panelType System.Type The type of panel to be created
panelId string A unique identifier for the panel, the id should be able to differeincae between two panels of the same type
arguments object>.Dictionary Arguments to be sent to the panel
return bool
Example #1
0
        /// <summary>
        /// Fired when the main page is loaded.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            // Set the current information to the UI.
            UpdateSubredditList(App.BaconMan.SubredditMan.SubredditList);
            UpdateAccount();

            // Request an update if needed
            App.BaconMan.SubredditMan.Update();
            App.BaconMan.UserMan.UpdateUser();

            // Get the default subreddit.
            string defaultDisplayName = App.BaconMan.UiSettingsMan.SubredditList_DefaultSubredditDisplayName;

            if (String.IsNullOrWhiteSpace(defaultDisplayName))
            {
                defaultDisplayName = "frontpage";
            }

            // Make sure we don't have an overwrite (launched from a secondary tile)
            if (!String.IsNullOrWhiteSpace(m_subredditFirstNavOverwrite))
            {
                defaultDisplayName = m_subredditFirstNavOverwrite;
            }

            // Navigate to the start
            Dictionary <string, object> args = new Dictionary <string, object>();

            args.Add(PanelManager.NAV_ARGS_SUBREDDIT_NAME, defaultDisplayName);
            m_panelManager.Navigate(typeof(SubredditPanel), defaultDisplayName + SortTypes.Hot + SortTimeTypes.Week, args);
            m_panelManager.Navigate(typeof(WelcomePanel), "WelcomePanel");

            // Update the trending subreddits
            UpdateTrendingSubreddits();

            // Show review if we should
            CheckShowReviewAndFeedback();
        }
Example #2
0
        /// <summary>
        /// Fired when the main page is loaded.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            //The app is always in Dark theme so it's good to insure that the Status bar is consistent.
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                var statusBar = StatusBar.GetForCurrentView();
                statusBar.ForegroundColor   = Colors.White;
                statusBar.BackgroundColor   = Color.FromArgb(255, 51, 51, 51);
                statusBar.BackgroundOpacity = 1;
            }
            // Set the current information to the UI.
            UpdateSubredditList(App.BaconMan.SubredditMan.SubredditList);
            UpdateAccount();

            // Request an update if needed
            App.BaconMan.SubredditMan.Update();
            App.BaconMan.UserMan.UpdateUser();

            // Get the default subreddit.
            var defaultDisplayName = App.BaconMan.UiSettingsMan.SubredditListDefaultSubredditDisplayName;

            if (string.IsNullOrWhiteSpace(defaultDisplayName))
            {
                defaultDisplayName = "frontpage";
            }

            // Make sure we don't have an overwrite (launched from a secondary tile)
            if (!string.IsNullOrWhiteSpace(_mSubredditFirstNavOverwrite))
            {
                defaultDisplayName = _mSubredditFirstNavOverwrite;
            }

            var defaultSortType = App.BaconMan.UiSettingsMan.SubredditListDefaultSortType;
            var defaultSortTime = App.BaconMan.UiSettingsMan.SubredditListDefaultSortTimeType;

            var args = new Dictionary <string, object>
            {
                { PanelManager.NavArgsSubredditName, defaultDisplayName }
            };

            _panelManager.Navigate(typeof(SubredditPanel), string.Concat(defaultDisplayName, defaultSortType, defaultSortTime), args);
            _panelManager.Navigate(typeof(WelcomePanel), "WelcomePanel");

            // Update the trending subreddits
            UpdateTrendingSubreddits();

            // Show review if we should
            CheckShowReviewAndFeedback();
        }