Skip to content

Repository files navigation

.NET MAUI 11 Preview Samples

Sample app that separates the new .NET MAUI 11 Preview 4 additions from the .NET MAUI 11 Preview 3 samples that are still included for comparison.

For the previous walkthrough, check out the video: What's New in .NET MAUI 11 Preview 3

Features

Preview 4 additions

  • Shell and ToolbarItem badgesBadgeText, BadgeColor, and BadgeTextColor on Shell tabs and primary toolbar items
  • CoreCLR runtime default — Preview 4 uses CoreCLR by default for .NET MAUI targets
  • Material 3 Android controls — sample ImageButton, DatePicker, Entry, and Slider controls that pick up the expanded Material 3 handlers on Android
  • x:Code directive — inline C# event handler declared directly in XAML
  • Compiled bindings in DataTemplates — strongly typed CollectionView template with x:DataType
  • dotnet watch for Android and iOS — project settings include the iOS simulator MtouchLink=None workaround from the Preview 4 release notes
  • Android themed iconsMauiIcon now declares a dedicated MonochromeFile layer

Preview 3 samples

Maps

  • Pin clustering — group nearby pins automatically with IsClusteringEnabled and ClusteringIdentifier
  • Custom pin icons — use any image as a pin marker via Pin.ImageSource
  • Long press to drop pinsMapLongClicked event for adding pins interactively
  • Overlay click eventsCircleClicked and PolygonClicked on map elements
  • Overlay visibility — toggle overlays with MapElement.IsVisible

LongPressGestureRecognizer

  • Built-in long press — first-party LongPressGestureRecognizer with configurable MinimumPressDuration
  • State trackingLongPressing event with GestureStatus for real-time feedback
  • Position trackingGetPosition() to get touch coordinates relative to any element

XAML Improvements

  • Implicit namespaces — no more xmlns= boilerplate; standard MAUI and x: namespaces are implicit in .NET 11
  • Source generation by default — XAML source gen is now on for all pages with lazy resource loading
  • New style APIsInvalidateStyle() and VisualStateManager.InvalidateVisualStates() for runtime style mutations

Prerequisites

Getting Started

git clone https://github.com/jfversluis/MauiNet11Preview3Sample.git
cd MauiNet11Preview3Sample

# iOS
dotnet build -f net11.0-ios
dotnet build -t:Run -f net11.0-ios

# Android
dotnet build -f net11.0-android
dotnet build -t:Run -f net11.0-android

# Hot Reload with Preview 4 dotnet watch
dotnet watch -f net11.0-android
dotnet watch -f net11.0-ios

Screenshots

Preview 4 additions Preview 3 Maps Preview 3 Long Press Preview 3 XAML
Badges, x:Code, Material 3, compiled DataTemplates Pin clustering, custom icons, overlays Configurable duration, position tracking Implicit namespaces, source gen

License

This project is licensed under the MIT License.

About

.NET MAUI 11 Preview 3 sample app - Maps, LongPressGestureRecognizer, XAML improvements

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages