public void Page_Loaded(object o, EventArgs e) { // Required to initialize variables _splash = new Splash(); canvas.Children.Add(_splash); _splash.SetValue(Canvas.ZIndexProperty, 20000); KeyHandler = new KeyHandler(); KeyHandler.Attach(this); Focus(); gameLoop = new GameLoop(); gameLoop.Attach(parentCanvas); gameLoop.Update += gameLoop_Update; Fps fps = new Fps(); canvas.Children.Add(fps); fps.SetValue(Canvas.ZIndexProperty, 1000); _mainMenu = new MainMenu(); canvas.Children.Add(_mainMenu); _mainMenu.MenuItemSelected += mainMenu_MenuItemSelected; Page_SizeChanged(null, null); }