public override void LoadContent() { gameplayHelper = PhoneApplicationService.Current.State[DodgeGame.GameStateKey] as GameplayHelper; PhoneApplicationService.Current.State[DodgeGame.InGameKey] = true; base.LoadContent(); }
void BackgroundLoadContent() { GameplayHelper gameplayHelper; // If we have never created a gameplay helper yet, now is the time. Otherwise, we simply need to reload its content, possibly if (PhoneApplicationService.Current.State.ContainsKey(DodgeGame.GameStateKey)) { gameplayHelper = PhoneApplicationService.Current.State[DodgeGame.GameStateKey] as GameplayHelper; } else { gameplayHelper = new GameplayHelper(ScreenManager.Game.Content, ScreenManager.SpriteBatch, ScreenManager.Game.GraphicsDevice); PhoneApplicationService.Current.State[DodgeGame.GameStateKey] = gameplayHelper; } if ((ScreenManager.Game as DodgeGame).ReloadRequired) { gameplayHelper.InitializeAssets(ScreenManager.Game.Content, ScreenManager.SpriteBatch, ScreenManager.Game.GraphicsDevice); gameplayHelper.LoadContent(); (ScreenManager.Game as DodgeGame).GameplayHelper = gameplayHelper; } }