Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Demonstrates a simple Xamarin / .NET MAUI app with a Todo list, adding tasks via UI, and displaying them in a ListView.
// MainPage.xaml.cs
using System.Collections.ObjectModel;
using Microsoft.Maui.Controls;
namespace TodoApp
{
public partial class MainPage : ContentPage
{
ObservableCollection<string> todos = new ObservableCollection<string>();
public MainPage()
{
InitializeComponent();
TodoList.ItemsSource = todos;
}
void AddTodo_Clicked(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(TodoEntry.Text))
{
todos.Add(TodoEntry.Text);
TodoEntry.Text = string.Empty;
}
}
}
}
// MainPage.xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TodoApp.MainPage">
<StackLayout Padding="20">
<Entry x:Name="TodoEntry" Placeholder="New Todo" />
<Button Text="Add" Clicked="AddTodo_Clicked" />
<ListView x:Name="TodoList" />
</StackLayout>
</ContentPage>Xamarin.MAUI (Multi-platform App UI) is a cross-platform framework for building native mobile, desktop, and tablet applications using C# and .NET with a single shared codebase.
Origin & Creator
Developed by Microsoft, evolving from Xamarin.Forms, officially released as .NET MAUI in 2022.
Industrial Note
Xamarin.MAUI is ideal for enterprises and developers targeting multiple platforms who want to maximize code sharing while retaining native performance and UI fidelity.