Created
September 3, 2017 13:45
-
-
Save Odonno/ce9deb076d8c791138b0b70c1958c3e3 to your computer and use it in GitHub Desktop.
Initialize ViewModel in GamePage of a C#/XAML MonoGame app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public GamePage(LaunchActivatedEventArgs args) | |
{ | |
InitializeComponent(); | |
// Add the data context | |
DataContext = ScoreViewModel.Instance; | |
// Create the game. | |
_game = XamlGame<Game1>.Create(args, Window.Current.CoreWindow, this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment