예제 #1
0
 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;
 }
예제 #2
0
        private static void startIndstillinger()
        {
            var startPage = Window.Current.Content as Indstillinger;
            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (startPage == null)
            {
                // Create a main GamePage
                startPage = new Indstillinger();

                if (_args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // TODO: Load state from previously suspended application
                }

                // Place the GamePage in the current Window
                Window.Current.Content = startPage;
            }

            // Ensure the current window is active
            Window.Current.Activate();
            startPage.ButtonClickedHandler += startPage_ButtonClickedHandler;
        }