I am a real beginner in cross-platform programming, .NET and C#.
I wrote a simple program, at the end it should pop up a window about who won the game. I'm using XAML with MVVM, I have an event in the model which gives back the winner. I did all the bindings in the XAML file, the app.cs has a private async void function which I think doesn't work for some reason.
It looks kinda like this:
private async void GameOver(object sender, modelEvent e)
{
if (e.result == 0)
{
await MainPage.DisplayAlert("Game", "Drawn!",
"OK");
}
if (e.result == 1)
{
await MainPage.DisplayAlert("Game", "First player won!",
"OK");
}
if (e.result == 2)
{
await MainPage.DisplayAlert("Game", "Second player won!",
"OK");
}
}
What might be the problem here?