protected override void OnFocusChanged(bool gainFocus, FocusSearchDirection direction, Rect previouslyFocusedRect) { base.OnFocusChanged(gainFocus, direction, previouslyFocusedRect); if (gainFocus) { _game.Resume(); } else { _game.Pause(); } }
protected override void OnFocusedChanged(EventArgs e) { base.OnFocusedChanged(e); if (Focused) { _game.InputDevice.Update(); _game.Resume(); _isPaused = false; } else { _isPaused = true; _game.Pause(); } }