MAUIverse MAUIverse

Building a Sliding Puzzle Game in .NET MAUI - Part 6

Up to this point the puzzle had levels to choose from but nothing to play. Part six connects the pieces: a new LevelPage hosts the SlidingTileGrid control, with a title and difficulty subtitle above it, and OnSizeAllocated sizes the grid to the smallest screen dimension.

Shaun then handles the navigation side. He registers the page and its route, passes the selected Level through Shell navigation using QueryProperty, and clears the selection so nothing is highlighted when the player comes back.

The remaining steps make it feel like a game:

  • Shuffling: the board is mixed by making 200 random moves of tiles next to the empty space.
  • Completion: a Completed event shows an alert and returns the player to level selection.

It’s a good read if you’re looking for a worked example of passing complex objects between pages in Shell.

View Source →

← Back to Community Feed

}