### Configuration and Setup Source: https://github.com/devexpress-examples/maui-data-form/blob/24.2.3+/_autodocs/00-START-HERE.txt Information on configuration properties, XAML examples, and default settings for the DataFormView control. This section guides users on how to set up and customize the form's overall behavior and appearance. ```APIDOC ## Configuration ### Description Covers the configuration properties, XAML examples, and default values for the DataFormView control. ### Namespace DevExpress.Maui.DataForm ### Related Files - `configuration.md` ### Properties Refer to `configuration.md` for a detailed list of configurable properties and their usage. ``` -------------------------------- ### Usage Examples Source: https://github.com/devexpress-examples/maui-data-form/blob/24.2.3+/_autodocs/00-START-HERE.txt Provides practical code examples demonstrating various ways to use the DataFormView control, from basic setup to complex scenarios. ```APIDOC ## Usage Examples ### Description Contains practical code examples illustrating the usage of the DataFormView control in different scenarios. ### Related Files - `usage-examples.md` ### Examples Refer to `usage-examples.md` for runnable code patterns and real-world application examples. ``` -------------------------------- ### Minimal Data Form Setup Source: https://github.com/devexpress-examples/maui-data-form/blob/24.2.3+/_autodocs/usage-examples.md Demonstrates the minimal setup for a DataFormView by binding it to a simple data object. The form automatically generates editors and labels based on the object's properties. ```csharp public class PersonalInfo { public string FirstName { get; set; } public string LastName { get; set; } public string Email { get; set; } } public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); dataForm.DataObject = new PersonalInfo(); } } ``` ```xaml ``` -------------------------------- ### Basic DataFormView Setup Source: https://github.com/devexpress-examples/maui-data-form/blob/24.2.3+/_autodocs/dataformview.md Demonstrates the basic initialization of DataFormView with a DataObject and setting editor box and validation modes. ```csharp var dataForm = new DataFormView { DataObject = new PersonalInfo(), EditorBoxMode = EditorBoxMode.Filled, ValidationMode = ValidationMode.PropertyChanged }; ``` -------------------------------- ### Complete DataForm Layout and Styling Example Source: https://github.com/devexpress-examples/maui-data-form/blob/24.2.3+/_autodocs/layout-and-styling.md Demonstrates a comprehensive setup for a MAUI DataForm, including data model attributes for layout and styling, and XAML for the DataFormView configuration. This example showcases group headers, row separators, and various editor-specific display options. ```csharp // Data model with layout attributes public class EmployeeInfo { [DataFormItemPosition(RowOrder = 1, ItemOrderInRow = 1)] [DataFormTextEditor(InplaceLabelText = "First Name")] [DataFormDisplayOptions( GroupName = "Personal Information", LabelIcon = "person")] public string FirstName { get; set; } [DataFormItemPosition(RowOrder = 1, ItemOrderInRow = 2)] [DataFormTextEditor(InplaceLabelText = "Last Name")] [DataFormDisplayOptions( GroupName = "Personal Information", IsLabelVisible = false)] public string LastName { get; set; } [DataFormItemPosition(RowOrder = 2, ItemOrderInRow = 1)] [DataFormTextEditor(Placeholder = "Email")] [DataFormDisplayOptions( GroupName = "Contact Information", LabelIcon = "email")] [EmailAddress] public string Email { get; set; } [DataFormItemPosition(RowOrder = 2, ItemOrderInRow = 2)] [DataFormMaskedEditor( Mask = "+1 (000) 000-0000", Placeholder = "Phone")] [DataFormDisplayOptions( GroupName = "Contact Information", LabelIcon = "phone")] public string Phone { get; set; } [DataFormDisplayOptions(GroupName = "Employment", LabelMinWidth = 150)] [DataFormDateEditor] public DateTime HireDate { get; set; } [DataFormDisplayOptions(GroupName = "Employment")] [DataFormComboBoxEditor(IsFilterEnabled = true)] public DepartmentType Department { get; set; } } // XAML setup ``` -------------------------------- ### Complete Edit Form Example with DataForm Source: https://github.com/devexpress-examples/maui-data-form/blob/24.2.3+/_autodocs/usage-examples.md A comprehensive example of an editable form including data binding, image display, and custom validation for email. This snippet demonstrates setting up the DataForm, handling save actions, and performing validation before saving. ```csharp public class Customer : BindableBase { private string firstName; [Required] public string FirstName { get => firstName; set { firstName = value; RaisePropertyChanged(); } } private string email; [EmailAddress] [Required] public string Email { get => email; set { email = value; RaisePropertyChanged(); } } private string photoPath; public string PhotoPath { get => photoPath; set { photoPath = value; RaisePropertyChanged(); } } } public partial class EditPage : ContentPage { public EditPage() { InitializeComponent(); var customer = new Customer(); dataForm.DataObject = customer; dataForm.PropertyValidation += ValidateProperties; } private void ValidateProperties(object sender, DataFormPropertyValidationEventArgs e) { if (e.PropertyName == "Email" && e.NewValue != null) { MailAddress res; if (!MailAddress.TryCreate(e.NewValue.ToString(), out res)) { e.HasError = true; e.ErrorText = "Invalid email"; } } } private void OnSaveClicked(object sender, EventArgs e) { dataForm.Commit(); if (dataForm.GetPropertyValidationError("Email") == null) { // Save to database SaveCustomer(); } } private async void SaveCustomer() { await DisplayAlert("Success", "Customer saved", "OK"); } } ``` ```xaml