我已经构建并部署了由 zune hd 的新项目模板创建的应用程序。问题是每当应用程序退出时,Zune 都会重新启动。从 PC 远程调试或直接从设备运行时会发生这种情况。它发生在调试模式和发布中。我已经包含了基本的模板代码,但它非常通用。有人有想法么?
public class DrawGame : Microsoft.Xna.Framework.Game
{
private GraphicsDeviceManager m_graphics;
private SpriteBatch m_spriteBatch;
public DrawGame()
{
m_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
}
protected override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
m_spriteBatch = new SpriteBatch(GraphicsDevice);
}
protected override void UnloadContent()
{ }
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
{
this.Exit();
}
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
m_spriteBatch.Begin();
m_spriteBatch.End();
base.Draw(gameTime);
}
}