O'Reilly logo

Mastering Xamarin UI Development - Second Edition by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and implementing the ResetGame_Clicked method

In this section, we will look at implementing the ResetGame_Clicked instance method in our ViewController class. The ResetGame_Clicked instance method will be responsible for resetting the game in progress, which, if you remember when we were constructing our user interface for our game, we created an event for with our Reset Game button.

Let's start by modifying the ViewController class for our SlidingTiles app by performing the following steps:

  1. Ensure that the ViewController.cs file is currently displayed in the code editor.
  2. Next, underneath the CreateGameBoard instance method, we need to create an event method called ResetGame_Clicked that will be called whenever the user taps on ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required