Exemplo n.º 1
0
        /// <summary>
        /// The methods provided in this section are simply used to allow
        /// NavigationHelper to respond to the page's navigation methods.
        /// <para>
        /// Page specific logic should be placed in event handlers for the
        /// <see cref="NavigationHelper.LoadState"/>
        /// and <see cref="NavigationHelper.SaveState"/>.
        /// The navigation parameter is available in the LoadState method
        /// in addition to page state preserved during an earlier session.
        /// </para>
        /// </summary>
        /// <param name="e">Provides data for navigation methods and event
        /// handlers that cannot cancel the navigation request.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null && e.Parameter.ToString().Equals("remove"))
            {
                removeParameter = "remove"; Frame.BackStack.Clear();
            }
            Apps app = AppInstance.app;

            updateTile();
            Init();
            if (app.Type.Contains("Info"))
            {
                AppReader.readInfoFile(app.Name); page = typeof(InfoPage);
            }
            else if (app.Type.Contains("Flash"))
            {
                AppReader.readFlashFile(app.Name); page = typeof(FlashCardPage);
            }
            else if (app.Type.Contains("Quiz"))
            {
                AppReader.readQuizFile(app.Name); QuizModel.clearInstance(); page = typeof(QuizPage);
            }
            else if (app.Type.Contains("Spellings"))
            {
                AppReader.readSpellingsFile(app.Name); SpellingsModel.clearInstance(); page = typeof(SpellingsPage);
            }
            else
            {
                Frame.GoBack();
            }
            this.navigationHelper.OnNavigatedTo(e);
            AppLogo.Source = new BitmapImage(new Uri(app.AppIcon));
            AppName.Text   = app.Name;
            AppAuthor.Text = app.Author;
        }