Пример #1
0
        protected override void LoadContent()
        {
            for (int i = 0; i < screens.Count; i++)
            {
                screens[i].LoadContent();
            }

            if (loadingScreen != null)
            {
                loadingScreen.LoadContent();
            }

            base.LoadContent();
        }
Пример #2
0
        public void TransitionTo <T>() where T : BaseScreen
        {
            var scr = GetOrCreateScreen <T>();

            nextScreen = scr;
            if (!nextScreen.IsReady)
            {
                nextScreen.LoadContent();
            }
            // Switch to loading screen if it exists
            if (loadingScreen != null)
            {
                if (curScreen != null)
                {
                    curScreen.OnNavigatedFrom();
                }
                curScreen = loadingScreen;
                curScreen.OnNavigatedTo();
            }
        }