Ejemplo n.º 1
0
        private void languagePicker_SelectedIndexChanged(object sender, EventArgs e)
        {
            //When a new language/tour is selected from eeh picker, a new "tour" object is made
            //and the main page is recreated. This is all a bit 'expensive', but it's not something
            //a user should be doing very often.
            if (tour.narationPlayer.isPlaying)
            {
                tour.narationPlayer.PlayOrPause();
            }

            int selectedLanguageNumber = tour.availableLanguages.Find(x => x.name == languagePicker.SelectedItem.ToString()).number;

            if (selectedLanguageNumber != Preferences.Get("language", 0))
            {
                Preferences.Set("language", selectedLanguageNumber);
                tour = new pnTour(selectedLanguageNumber);
                (Application.Current).MainPage = new NavigationPage(new MainPage());
            }
        }
Ejemplo n.º 2
0
        public App()
        {
            InitializeComponent();

            if (!Preferences.ContainsKey("guid"))
            {
                Preferences.Set("guid", Guid.NewGuid().ToString());
            }

            if (!Preferences.ContainsKey("volume"))
            {
                Preferences.Set("volume", 0.5);
            }

            if (!Preferences.ContainsKey("language"))
            {
                Preferences.Set("language", 0);
            }

            tour = new pnTour(Preferences.Get("language", 0));

            MainPage = new NavigationPage(new MainPage( ));
        }