Bindable Properties
Learn how bindable properties work in .NET MAUI.
We'll cover the following...
In .NET MAUI, bindable properties on XAML elements are element properties that we can apply data binding on. These properties are represented by attributes in XAML, and they don't necessarily represent C# properties on the classes that represent the XAML elements.
In this lesson, we'll cover bindable properties. For this, we'll use the following project setup:
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#512BD4</color> <color name="colorPrimaryDark">#2B0B98</color> <color name="colorAccent">#2B0B98</color> </resources>
.NET MAUI project example with demonstration of built-in bindable properties
Bindable properties basics
If we open the MainPage.xaml
file in the project setup above, we'll see many examples of bindable properties. Some of them are highlighted. ...