From the course: .NET 9 Maui: Enhanced Features for Cross-Platform Development

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

Compiled bindings in XAML

Compiled bindings in XAML

- [Instructor] In the last video, we looked at how compiled bindings could be added in code. We also learned that some of the scenarios where it was impossible in .NET 8 to do this in XML are now possible. In this video, we will look at how to do these things. If you get the start code for this video, you will see the screens have gone back to being XML. Unfortunately, compiled bindings for all their benefits are harder to do in XML. To start with, in .NET 9 compiled bindings to the source attribute are possible but are not enabled by default. To enable it, we need to edit the project file. So I'm going to go in and right click on QR tracker and go edit the project file. And in this first property group section, I'm going to go to the bottom here and I'm going to add a new setting. So the setting is Maui and it'll be enable XamlCBinding with source compilation. And we're going to set that to true and we're going to save the project file and we'll close that up. Now that we have…

Contents