Esempio n. 1
0
        /// <summary>
        /// Fired when a sort menu item is tapped.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SortMenuItem_Click(object sender, RoutedEventArgs e)
        {
            // Get the new sort
            if (!(sender is MenuFlyoutItem item))
            {
                return;
            }
            var newType = GetSortFromString(item.Text);

            // Don't do anything if we already are.
            if (newType == _currentSortType)
            {
                return;
            }

            // Navigate to the new page
            var args = new Dictionary <string, object>
            {
                { PanelManager.NavArgsSubredditName, _subreddit.DisplayName },
                { PanelManager.NavArgsSubredditSort, newType },
                { PanelManager.NavArgsSubredditSortTime, _currentSortTimeType }
            };

            _host.Navigate(typeof(SubredditPanel), _subreddit.GetNavigationUniqueId(newType, _currentSortTimeType), args);
        }
Esempio n. 2
0
        /// <summary>
        /// Navigates to a subreddit.
        /// </summary>
        /// <param name="subreddit"></param>
        private void NavigateToSubreddit(Subreddit subreddit)
        {
            Dictionary <string, object> args = new Dictionary <string, object>();

            args.Add(PanelManager.NAV_ARGS_SUBREDDIT_NAME, subreddit.DisplayName.ToLower());
            m_panelManager.Navigate(typeof(SubredditPanel), subreddit.GetNavigationUniqueId(SortTypes.Hot, SortTimeTypes.Week), args);
        }
Esempio n. 3
0
        /// <summary>
        /// Navigates to a subreddit.
        /// </summary>
        /// <param name="subreddit"></param>
        private void NavigateToSubreddit(Subreddit subreddit)
        {
            var args = new Dictionary <string, object>();

            args.Add(PanelManager.NavArgsSubredditName, subreddit.DisplayName.ToLower());
            _panelManager.Navigate(typeof(SubredditPanel), subreddit.GetNavigationUniqueId(SortTypes.Hot, SortTimeTypes.Week), args);
        }
        /// <summary>
        /// Fired when a sort menu item is tapped.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SortMenuItem_Click(object sender, RoutedEventArgs e)
        {
            // Get the new sort
            MenuFlyoutItem item    = sender as MenuFlyoutItem;
            SortTypes      newType = GetSortFromString(item.Text);

            // Don't do anything if we already are.
            if (newType == m_currentSortType)
            {
                return;
            }

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

            args.Add(PanelManager.NAV_ARGS_SUBREDDIT_NAME, m_subreddit.DisplayName);
            args.Add(PanelManager.NAV_ARGS_SUBREDDIT_SORT, newType);
            args.Add(PanelManager.NAV_ARGS_SUBREDDIT_SORT_TIME, m_currentSortTimeType);
            m_host.Navigate(typeof(SubredditPanel), m_subreddit.GetNavigationUniqueId(newType, m_currentSortTimeType), args);
        }