예제 #1
0
        public void MoveToPage(byte page)
        {
            switch (page)
            {
            case 1:
                if (pageOne == null)
                {
                    pageOne = new WelcomePageOne();
                    welcomePage.WelcomePageFrame.Navigate(pageOne);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageOne);
                }
                break;

            case 2:
                if (pageTwo == null)
                {
                    pageTwo = new WelcomePageTwo();
                    welcomePage.WelcomePageFrame.Navigate(pageTwo);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageTwo);
                }
                break;

            case 3:
                if (pageThree == null)
                {
                    pageThree = new WelcomePageThree();
                    welcomePage.WelcomePageFrame.Navigate(pageThree);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageThree);
                }
                break;
            }
        }
예제 #2
0
        public void MoveToPage(byte page)
        {
            switch (page)
            {
            case 1:
                Page1();
                break;

            case 2:
                Page2();
                break;

            case 3:
                Page3();
                break;
            }

            void Page1()
            {
                if (pageOne == null)
                {
                    pageOne = new WelcomePageOne();
                    welcomePage.WelcomePageFrame.Navigate(pageOne);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageOne);
                }
            }

            void Page2()
            {
                if (ConfigManager.ProfileList.profiles.Count() != 0)
                {
                    Properties.LauncherSettings.Default.CurrentProfile = ConfigManager.ProfileList.profiles.FirstOrDefault().Key;
                    Properties.LauncherSettings.Default.Save();
                    MoveToPage(3);
                }
                else
                {
                    if (pageTwo == null)
                    {
                        pageTwo = new WelcomePageTwo();
                        welcomePage.WelcomePageFrame.Navigate(pageTwo);
                    }
                    else
                    {
                        welcomePage.WelcomePageFrame.Navigate(pageTwo);
                    }
                }
            }

            void Page3()
            {
                if (pageThree == null)
                {
                    pageThree = new WelcomePageThree();
                    welcomePage.WelcomePageFrame.Navigate(pageThree);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageThree);
                }
            }
        }
예제 #3
0
        public void MoveToPage(byte page, bool backup = false)
        {
            switch (page)
            {
            case 1:
                Page1();
                break;

            case 2:
                Page2();
                break;

            case 3:
                Page3();
                break;

            case 4:
                Page4();
                break;

            case 5:
                Page5();
                break;

            case 6:
                Page6(backup);
                break;
            }

            void Page1()
            {
                if (pageOne == null)
                {
                    pageOne = new WelcomePageOne();
                    welcomePage.WelcomePageFrame.Navigate(pageOne);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageOne);
                }
            }

            void Page2()
            {
                if (pageTwo == null)
                {
                    pageTwo = new WelcomePageTwo();
                    welcomePage.WelcomePageFrame.Navigate(pageTwo);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageTwo);
                }
            }

            void Page3()
            {
                if (LauncherModel.Default.Config.profiles.Count() != 0)
                {
                    Properties.LauncherSettings.Default.CurrentProfile = LauncherModel.Default.Config.profiles.FirstOrDefault().Key;
                    Properties.LauncherSettings.Default.Save();
                    MoveToPage(4);
                }
                else
                {
                    if (pageThree == null)
                    {
                        pageThree = new WelcomePageThree();
                        welcomePage.WelcomePageFrame.Navigate(pageThree);
                    }
                    else
                    {
                        welcomePage.WelcomePageFrame.Navigate(pageThree);
                    }
                }
            }

            void Page4()
            {
                if (pageFour == null)
                {
                    pageFour = new WelcomePageFour();
                    welcomePage.WelcomePageFrame.Navigate(pageFour);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageFour);
                }
            }

            void Page5()
            {
                if (pageFive == null)
                {
                    pageFive = new WelcomePageFive();
                    welcomePage.WelcomePageFrame.Navigate(pageFive);
                }
                else
                {
                    welcomePage.WelcomePageFrame.Navigate(pageFive);
                }
            }

            void Page6(bool _backup)
            {
                if (_backup)
                {
                    LauncherModel.Default.GameManager.Backup();
                }
                ViewModels.LauncherModel.Default.SetOverlayFrame_Strict(null);
                Properties.LauncherSettings.Default.IsFirstLaunch = false;
                Properties.LauncherSettings.Default.Save();
                LauncherModel.Default.Reload();
            }
        }