public void Update(float deltaTime) { if (Keyboard.GetState().IsKeyDown(Keys.F1) && lastKeyboard.IsKeyUp(Keys.F1)) { SaveFileDialog saveFile = new SaveFileDialog() { Filter = "Xml files|*.xml|All Files|*.*" }; if (saveFile.ShowDialog() == true) { SaveMap.Save(saveFile.FileName); } } lastKeyboard = Keyboard.GetState(); }