Skip to content

Plugin.Maui.DynamicForms is a .NET MAUI library for building dynamic, metadata-driven forms at runtime—no UI code needed. Supports validation, theming, and cross-platform layouts for fast, flexible form generation

License

Notifications You must be signed in to change notification settings

corweg/Plugin.Maui.DynamicForms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plugin.Maui.DynamicForms

.NET MAUI License: MIT NuGet

A powerful .NET MAUI library for building dynamic, metadata-driven forms at runtime - no UI code required!

Build complex, production-ready forms in minutes with full validation, theming, and cross-platform support. Perfect for admin panels, data entry apps, configuration UIs, and any scenario requiring flexible form generation.

Form Styles Showcase


🎯 Why Plugin.Maui.DynamicForms?

Stop writing repetitive UI code. Define your forms once as metadata, and let the library handle the rest - rendering, validation, data binding, and styling.

graph LR
 A[Define Metadata] --> B[DynamicFormView]
 B --> C[Beautiful UI]
 C --> D[Validated Data]
 D --> E[Your Business Logic]
 style B fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff
Loading

✨ Key Features

  • 🚀 Zero UI Code - Build forms from simple metadata definitions
  • 🎨 8 Built-in Themes - Professional styles ready out-of-the-box
  • Enterprise Validation - FluentValidation, DataAnnotations, or custom validators
  • 🔄 Fluent API - Modern FormBuilder for clean, readable code
  • 📱 True Cross-Platform - Android, iOS, Windows, macOS support
  • 🌐 Async-First - Built for modern async/await patterns and API integration
  • 🎯 Type-Safe - Full C# type safety with DTO binding
  • 🔧 Fully Customizable - Every visual aspect can be styled via XAML

1. Install via NuGet

dotnet add package Plugin.Maui.DynamicForms

2. Configure MauiProgram.cs

using CommunityToolkit.Maui;

builder.UseMauiApp<App>()
    .UseMauiCommunityToolkit();  // Required

3. Add Default Styles to App.xaml

<Application xmlns:styles="clr-namespace:Plugin.Maui.DynamicForms.Resources.Styles;assembly=Plugin.Maui.DynamicForms"
             ...>
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <styles:FormStyleDefault />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

4. Use in Your Page

<ContentPage xmlns:forms="clr-namespace:Plugin.Maui.DynamicForms.Controls;assembly=Plugin.Maui.DynamicForms"
             ...>
    <forms:DynamicFormView x:Name="MyFormView" />
</ContentPage>
// Define form structure
var fields = new FormBuilder()
    .BeginBlock("Contact Information")
        .AddTextField("Name").WithRequiredValidation()
        .AddTextField("Email").WithRequiredValidation()
        .AddTextField("Phone")
    .Build();

// Assign to form
MyFormView.FormFields = fields;

// Add Validators
MyFormView.FieldValidators.Add(new RequiredFieldValidator());

// Handle save
MyFormView.FormSaved += (s, e) => {
    var name = e.FormFields.First(f => f.Property == "Name").Value;
    // Process form data...
};

That's it! You now have a fully functional, validated, styled form. 🎉


💡 Perfect For

mindmap
  root((Use Cases))
    Admin Panels
      User Management
      Settings Configuration
      System Setup
    Data Entry
      Customer Forms
      Survey Collection
      Registration Forms
    Dynamic Content
      CMS Forms
      Report Builders
   Filter Interfaces
   LOB Apps
     Employee Records
        Order Entry
        Inventory Management
Loading
  • Admin Panels - Quickly build configuration and management interfaces
  • Data Collection Apps - Surveys, registrations, feedback forms
  • Business Applications - Employee records, customer data, order entry
  • Dynamic Workflows - Forms that change based on business rules
  • Rapid Prototyping - Build and iterate on forms in minutes

🎨 Visual Themes

Choose from 8 professionally designed themes, or create your own:

Theme Style Best For
Base Styling Clean & minimal Production apps
Modern Dark Sleek dark mode Modern UIs
Pastel Dream Soft & friendly Consumer apps
Ocean Blue Professional blue Corporate apps
Forest Green Nature-inspired Eco/outdoor apps
Sunset Orange Warm & inviting Creative apps
OENext Custom branded Enterprise
Test Styling Debug-friendly Development

Switch themes at runtime with a single line:

Application.Current.Resources.MergedDictionaries.Add(new FormStyleModernDark());
MyForm.RefreshForm();

📊 Architecture Overview

graph TB
    subgraph "Your App"
        A[XAML Page] --> B[DynamicFormView]
        C[Business Logic] --> D[DTO Models]
    end
    
    subgraph "Plugin.Maui.DynamicForms"
        B --> E[FormBuilder]
        E --> F[FieldMetaData]
        F --> G[FormControlFactory]
        G --> H[Rendered Controls]
        I[Validation Engine] --> H
        J[Style Engine] --> H
        D <--> K[FormDataConverter]
        K <--> F
    end
 
    style B fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff
    style G fill:#2196F3,stroke:#333,stroke-width:2px,color:#fff
Loading

🔥 Advanced Features

FluentValidation Integration

public class PersonValidator : AbstractValidator<PersonModel>
{
    public PersonValidator()
    {
        RuleFor(x => x.Email).EmailAddress();
        RuleFor(x => x.Age).InclusiveBetween(18, 100);
    }
}

MyForm.FormValidator = new FluentValidationFormValidator<PersonModel>(new PersonValidator());

Async API Data Loading

var customerData = await apiService.GetCustomerAsync(customerId);
var formFields = FormBuilder.CreateCustomerForm();
formFields = FormDataConverter.Dto2FormData(formFields, customerData);
MyForm.FormFields = formFields;

Multi-Block Forms

var form = new FormBuilder()
 .BeginBlock("Personal Info", isExpanded: true)
        .AddTextField("FirstName")
        .AddTextField("LastName")
    .NextBlock()
    .BeginBlock("Contact Info", isExpanded: false)
        .AddTextField("Email")
        .AddTextField("Phone")
    .Build();

📚 Documentation

Document Description
Library Documentation Complete technical reference, API docs, styling guide
Sample Application 9 working examples with code walkthroughs

🏗️ Project Structure

/
├── src/
│   └── Plugin.Maui.DynamicForms/         # 📦 Main library (NuGet package)
│       ├── Controls/                     # DynamicFormView control
│       ├── Models/                       # FieldMetaData, FieldType
│       ├── Factories/                    # FormBuilder, FormControlFactory
│       ├── Validation/                   # Validation engine & interfaces
│       ├── Helpers/                      # Data converters, utilities
│       └── Documentation/                # Technical docs
│
├── Samples/
│   └── Plugin.Maui.DynamicForms.Sample/  # 📱 Demo application
│       ├── Examples/                     # 9 example forms
│       ├── Resources/Styles/             # 8 theme implementations
│       └── Validation/                   # FluentValidation examples
│
└── README.md     # 👈 You are here

🔧 Requirements

  • .NET 10.0 or higher
  • .NET MAUI 10.0+
  • CommunityToolkit.Maui 12.1.0+
  • Supported Platforms:
    • ✅ Android 21+
    • ✅ iOS 15+
    • ✅ macOS Catalyst 15+
    • ✅ Windows 10 (10.0.17763.0+)

🎓 Learn by Example

The Sample Application includes 9 complete examples:

  1. Example Form - FluentValidation showcase
  2. Address Form - Multi-block with dual data binding
  3. Contact Form - Simple starter example
  4. Registration Form - Password confirmation, T&C
  5. Employee Form - Complex multi-section business form
  6. Event Registration - Radio groups, date/time pickers
  7. Feedback Form - Text areas, ratings
  8. Survey Form - Multi-topic questionnaire
  9. Customer Form - Async API data loading

Each example includes:

  • ✅ Full source code with comments
  • ✅ Working validation
  • ✅ DTO binding examples
  • ✅ Best practices demonstrated

👋 About us

We are Ralf Corinth and Torsten Weggen — lifelong software developers and innovators with a passion for building systems that last.

About Ralf

  • 🎓 Studied Mechanical Engineering with a focus on Production Technology in Lübeck (1978–1981).
  • 💻 Developed early software for analyzing electric motor measurements as part of his thesis.
  • 🏢 Led software development at Philips until 1989, experiencing the evolution from punch cards to large-scale data systems.
  • 🚀 Founded his own company in 1989, introducing ERP systems and later creating O&E, an integrated CRM/ERP solution.
  • 🌟 Inventor of the SML (SachMerkmalLeiste), a flexible way to document machine-specific attributes, later extended to all kinds of products and data.
  • 🔧 Today, even in retirement, Ralf continues to innovate with .NET MAUI and the Dynamic Data Form (DDF), enabling adaptive, beautiful forms across devices.

About Torsten

  • 💡 Fullstack Software developer by heart and soul, with decades of experience in enterprise systems and open-source projects.
  • 🏢 Currently part of Hannover Rück-Gruppe, with a background in building scalable solutions and contributing to the developer community.
  • 📚 Author of Auktionsbuddy 4.0, a comprehensive eBay auction management tool.
  • 🏆 Recognized as a DNN MVP multiple times (2013–2018) for contributions to the DotNetNuke ecosystem.
  • 🎓 Studied at Fachhochschule Wedel, with strong expertise in modern web technologies.
  • 🌍 Passionate about creating software that balances performance, usability, and adaptability.

Our Collaboration

Together, we combined Ralf’s SML concept with Torsten’s technical expertise to create the Dynamic Data Form (DDF) — a system that generates responsive, elegant forms on any device. Our mission is to inspire developers with practical, performance-driven solutions that stand the test of time.

A New Chapter

As we reach the final stretch of our professional journey, we’re more motivated than ever to share what we’ve learned and built. If our work has helped you or sparked new ideas, we’d be grateful for your support. A few kind sponsors could help sweeten this last chapter of our lives — and keep the spirit of innovation alive.
👉 Become a sponsor


💬 If you enjoy our work, feel free to connect or support us.
📧 Questions? Reach out via email.

🤝 Contributing

We love contributions! Here's how you can help:

Ways to Contribute

  • 🐛 Report Bugs - Open an issue
  • 💡 Suggest Features - Share your ideas
  • 🎨 Submit Themes - Create and share custom styles
  • 📝 Improve Docs - Help us make docs better
  • 🔧 Submit PRs - Fix bugs or add features

Development Setup

# Clone the repository
git clone https://github.com/corweg/Plugin.Maui.DynamicForms.git
cd Plugin.Maui.DynamicForms

# Open in Visual Studio 2022
# Set Plugin.Maui.DynamicForms.Sample as startup project
# Build and run!

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Copyright © 2025 Torsten Weggen / Ralf Corinth

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

🌟 Show Your Support

If you find this library useful, please consider:

  • Star this repository on GitHub
  • 📢 Share with your network
  • 🐦 Tweet about it - @weggetor
  • 💬 Join discussions in the Issues section

🔗 Links & Resources

Resource Link
NuGet Package Plugin.Maui.DynamicForms
GitHub Repository corweg/Plugin.Maui.DynamicForms
Report Issues Issue Tracker
Sample App Live Demo Code
API Documentation Technical Docs

💬 Community & Support

  • 📧 Questions? Open an issue with the question label
  • 🐛 Found a bug? Open an issue with the bug label
  • 💡 Feature request? Open an issue with the enhancement label

🙏 Acknowledgments

Built with ❤️ using:

Special thanks to the .NET MAUI community for their continuous support and feedback!


⬆ back to top

Built with ❤️ for the .NET MAUI Community

Made by Torsten WeggenRalf Corinth

About

Plugin.Maui.DynamicForms is a .NET MAUI library for building dynamic, metadata-driven forms at runtime—no UI code needed. Supports validation, theming, and cross-platform layouts for fast, flexible form generation

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •