Search⌘ K

Try It Yourself

Explore how to modify and interact with .NET MAUI XAML views by practicing event handling using sender parameters. Learn to replace VerticalStackLayout with a Grid layout to organize UI elements efficiently. This lesson helps you build a solid understanding of dynamic UI adjustments and layout structuring in MAUI applications.

The interactive playground below contains a .NET MAUI project that is set up with the views covered in this chapter. You can apply modifications to it and see how they affect the structure of the compiled application. You can apply the following steps to practice all the concepts learned in this chapter:

  • Use event sender in code-behind.

  • Turn VericalStackLayout into a Grid layout.

Using event sender in code-behind

Let's open the MainPage.xaml.cs file. Its contents ...