//private void SetStatus(string status) //{ // lblStatus.Text = status; // lblStatus.Invalidate(); // lblStatus.Update(); // lblStatus.Refresh(); // Application.DoEvents(); //} private async void paintCanvas_Tapped(object sender, TappedRoutedEventArgs e) { int rectSize = (int)paintCanvas.Width / game.GridSize; // Find row, col of mouse press Point mousePosition = e.GetPosition(paintCanvas); int row = (int)(mousePosition.Y) / rectSize; int col = (int)(mousePosition.X) / rectSize; game.Move(row, col); // Redraw the board DrawGrid(); //SetStatus(); game.checkMove(); DrawGrid(); if (game.IsGameOver()) { MessageDialog msgDialog = new MessageDialog("Congratulations! You've won!", "Matching Game"); // Add an OK button msgDialog.Commands.Add(new UICommand("OK")); // Show the message box and wait aynchrously for a button press IUICommand command = await msgDialog.ShowAsync(); // This executes *after* the OK button was pressed game.NewGame(); DrawGrid(); } }