Ejemplo n.º 1
0
        /// <summary>
        /// Override navigate event to change the Pivot's currect item.
        /// Call this when you're not in MainScreen.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            string itemIndex;

            if (NavigationContext.QueryString.TryGetValue("goto", out itemIndex))
            {
                EPivotPage page = (EPivotPage)Convert.ToInt32(itemIndex);
                this.MoveToPage(page);
            }

            base.OnNavigatedTo(e);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fetch data on specfici swcreen
        /// </summary>
        /// <param name="p_page"></param>
        private void FetchDataForPage(EPivotPage p_page)
        {
            switch (p_page)
            {
            case EPivotPage.TodaysActivity:
            {
                this.FetchTodaysData();
            }
            break;

            case EPivotPage.OverallActivity:
            {
                this.FetchOverallData();
            }
            break;

            case EPivotPage.SportsMode:
            {
            }
            break;

            case EPivotPage.DailyTarget:
            {
            }
            break;

            case EPivotPage.PersonalProfile:
            {
            }
            break;

            case EPivotPage.Settings:
            {
            }
            break;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handle the change pivot view
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnPivotChangedPage(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            // TODO: Add event handler implementation here.
            KreyosUtils.Log("MainScreen::OnPivotChangedPage", "update, do something here..");
            Pivot      page       = (Pivot)sender;
            PivotItem  item       = (PivotItem)page.SelectedItem;
            string     pageName   = item.Name;
            EPivotPage pageToLoad = ScreenManager.PageMap[pageName];

            //~~~check if screen is already loaded
            if (m_loadedScreen[(int)pageToLoad] == true)
            {
                this.FetchDataForPage(pageToLoad);
                return;
            }

            //~~~set the flag to load
            m_loadedScreen[(int)pageToLoad] = true;

            switch (pageToLoad)
            {
            case EPivotPage.TodaysActivity:
            {
                this.InitTodaysActivity();
                item.UpdateLayout();
            }
            break;

            case EPivotPage.OverallActivity:
            {
                this.InitActivityStats();
                item.UpdateLayout();
            }
            break;

            case EPivotPage.SportsMode:
            {
                this.InitSportsMode();
                item.UpdateLayout();
            }
            break;

            case EPivotPage.DailyTarget:
            {
                this.InitDailyTarget();
                item.UpdateLayout();
            }
            break;

            case EPivotPage.PersonalProfile:
            {
                this.InitProfile();
                item.UpdateLayout();
            }
            break;

            case EPivotPage.Settings:
            {
            }
            break;
            }

            KreyosUtils.Log("MainScreen::OnPivotChangedPage", "Loaded Page:" + pageName);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Call this when you're in MainScreen
        /// </summary>
        /// <param name="p_page"></param>
        public void MoveToPage(EPivotPage p_page)
        {
            EPivotPage page = (EPivotPage)p_page;

            this.MainPivot.SelectedItem = this.MainPivot.Items[(Int32)page];
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Fetch data on specfici swcreen
        /// </summary>
        /// <param name="p_page"></param>
        private void FetchDataForPage (EPivotPage p_page)
        {
            switch (p_page)
            {
                case EPivotPage.TodaysActivity:
                {
                    this.FetchTodaysData();
                }
                break;

                case EPivotPage.OverallActivity:
                {
                    this.FetchOverallData();
                }
                break;

                case EPivotPage.SportsMode:
                {
                }
                break;

                case EPivotPage.DailyTarget:
                {
                }
                break;

                case EPivotPage.PersonalProfile:
                {
                }
                break;

                case EPivotPage.Settings:
                {
                }
                break;
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Call this when you're in MainScreen
 /// </summary>
 /// <param name="p_page"></param>
 public void MoveToPage (EPivotPage p_page)
 {
     EPivotPage page = (EPivotPage)p_page;
     this.MainPivot.SelectedItem = this.MainPivot.Items[(Int32)page];
 }