public GamePage(LaunchActivatedEventArgs args, Indstillinger indstil) { _indstil = indstil; this.InitializeComponent(); // Create the game. game = XamlGame<Vendespillet>.Create(args, Window.Current.CoreWindow, this); game.gamePage = this; }
private void StartGame() { Serializer serializer = new Serializer(); SettingsState state = new SettingsState(); state.tidFortoning = numericUpDownTimeFade.Value; state.tidFoerFortoning = numericUpDownTimeNotification.Value; state.tidVist = NumericUpDownTimeShown.Value; state.tidVend = numericUpDownTimeTurn.Value; state.screen = (string)listBoxSkærme.SelectedItem; serializer.SerializeObject("settings.bin", state); if (listBoxSkærme.SelectedItem == null) { GlobalValues.currentScreen = Screen.AllScreens.First(s => s.Primary); } else { GlobalValues.currentScreen = Screen.AllScreens.First(s => s.DeviceName == listBoxSkærme.SelectedItem.ToString()); } this.Hide(); using (var game = new Vendespillet()) game.Run(); this.Show(); }