.NET MAUI DataForm Editors Styling
The DataForm control for .NET MAUI provides styling options for customizing the appearance of its editors. You have to apply a style to each editor individually.
Each editor provides the following properties:
-
BackgroundColor
—Defines the background color of the editor. -
BorderColor
—Defines the border color of the editor. -
BorderThickness
—Specifies the border thickness of the editor. -
EditorStyle
(Style
withTargetType
depending on the input control which the editor uses). For example, the target type of theRadCheckBoxEditor
isRadCheckBox
.
Example
The following example shows how to style the DataForm:
1. Define the RadDataForm
and the editors:
Note that local
in the snippet above points to the namespace where the EditorsViewModel
is defined.
2. Define the CheckBoxStyle
for the DataFormRadCheckBoxEditor
:
3. Add the following namespace:
4. Define the ViewModel
used as a BindingContext
for the RadDataForm
:
The following image shows what the DataForm control looks like when the styles described above are applied:
For a runnable example with the DataForm Editors Styling scenario, see the SDKBrowser Demo Application and go to DataForm > Styling category.