Welcome to MAUI Documentation
.NET MAUI (Multi-platform App UI) is an open-source framework for creating native mobile and desktop apps with C# and XAML from a single shared codebase. It builds on the skills and patterns of Xamarin.Forms and allows developers to build apps that can run on Android, iOS, macOS, and Windows.
What is .NET MAUI?
.NET MAUI is the next generation of .NET for cross-platform development. It provides a unified platform for building visually stunning, high-performance applications for Windows, macOS, Android, and iOS. With MAUI, you can leverage your C# and XAML expertise to create a single application that targets multiple platforms natively.
Key Features
- Single Project: A simplified project structure that manages all target platforms.
- Native Performance: Apps compile to native code for each platform, delivering excellent performance.
- Extensibility: Customize platform-specific behaviors and extend the framework.
- Modern C# and XAML: Utilize the latest C# language features and XAML for UI design.
- Rich UI Controls: A comprehensive set of controls that render natively on each platform.
Getting Started
To begin your journey with .NET MAUI, you'll need the .NET SDK installed. You can find detailed installation instructions and a quick start guide on our Getting Started page.
Core Components
Understanding the core components of MAUI is crucial for effective development. Here are some of the most important ones:
UI Elements
MAUI offers a rich set of pre-built UI controls that abstract away platform-specific implementations. These include buttons, labels, text inputs, images, and more. These controls are designed to be styled and customized to match your application's branding.
Layouts
Organize your UI elements efficiently using MAUI's powerful layout containers. Common layouts include:
VerticalStackLayout
: Arranges children vertically.HorizontalStackLayout
: Arranges children horizontally.Grid
: Arranges children in rows and columns.FlexLayout
: Provides flexible box layout for complex arrangements.
Data Binding
MAUI's data binding engine allows you to synchronize data between your UI elements and your application's data models. This significantly reduces boilerplate code and simplifies UI updates.
Navigation
Implement intuitive navigation within your MAUI applications using the built-in navigation stack and routing mechanisms.
API Reference Snippet
Here's a glimpse of how you might define a simple button in MAUI XAML:
<Button Text="Click Me"
BackgroundColor="{StaticResource Primary}"
TextColor="White"
CornerRadius="5"
Padding="10,15"
Clicked="OnButtonClicked" />
And here's a corresponding C# event handler:
private void OnButtonClicked(object sender, EventArgs e)
{
// Handle button click logic
System.Diagnostics.Debug.WriteLine("Button was clicked!");
}
Community & Support
Join the vibrant .NET MAUI community! You can find support, share your projects, and contribute to the framework on platforms like GitHub and Stack Overflow.