void MainPage_Loaded(object sender, RoutedEventArgs e) { _game = new Game(new Vector2() { X = (float)this.ActualWidth, Y = (float)this.ActualHeight }); _game.AttachToControl(Canvas); this.Focus(FocusState.Keyboard); _game.AttachKeyEvents(this); }