Skip to content

Shell Releases

Fix
INavigationConfirmation no longer triggers during programmatic navigation — CanNavigate() is now only called for user-initiated navigation (back button, tab switches), not when navigating via INavigator methods
Feature
SwitchShell — swap the entire active Shell at runtime via INavigator.SwitchShell(shell) or INavigator.SwitchShell<TShell>() (DI-resolved). Fires Navigating/Navigated events with NavigationType.SwitchShell and respects INavigationAware.OnNavigatingFrom
Feature
SwitchShell<TShell>() — generic overload resolves the Shell from the DI container, enabling constructor-injected Shell instances
Feature
NavigationType.SwitchShell — new enum value for tracking shell switches in navigation events and analytics
Feature
IDialogs interface — new dedicated dialog service with Alert, Confirm, Prompt, and ActionSheet methods, injected separately from INavigator for clean separation of concerns
Feature
Prompt dialog — display a text input dialog with customizable keyboard type, placeholder, initial value, and max length
Feature
ActionSheet dialog — display a multi-option action sheet with cancel and destructive action support
BREAKING Enhancement
Alert and Confirm moved from INavigator to IDialogs — improves testability and follows interface segregation
  • INavigator.Alert() and INavigator.Confirm() have been removed — inject IDialogs instead
  • Replace navigator.Alert(...) with dialogs.Alert(...) and navigator.Confirm(...) with dialogs.Confirm(...)
  • Add IDialogs to your ViewModel constructor parameters where dialogs are used
  • IDialogs is automatically registered by UseShinyShell() — no additional setup required
// Before (v2.x)
public class MyViewModel(INavigator navigator)
{
await navigator.Alert("Error", "Something went wrong");
bool ok = await navigator.Confirm("Delete?", "Are you sure?");
}
// After (v3.0)
public class MyViewModel(INavigator navigator, IDialogs dialogs)
{
await dialogs.Alert("Error", "Something went wrong");
bool ok = await dialogs.Confirm("Delete?", "Are you sure?");
// New capabilities
var name = await dialogs.Prompt("Name", "Enter your name");
var choice = await dialogs.ActionSheet("Options", "Cancel", null, "Edit", "Share");
}
Feature
Configurable source generation — disable route constants via ShinyMauiShell_GenerateRouteConstants or navigation extensions via ShinyMauiShell_GenerateNavExtensions MSBuild properties (empty/missing = enabled, false = disabled)
Feature
Route-based naming — the route parameter in [ShellMap] now drives the generated constant name and navigation method name (e.g., [ShellMap<HomePage>("Dashboard")]Routes.Dashboard, NavigateToDashboard)
Feature
Invalid route diagnostic — SHINY001 compiler error when the route value is not a valid C# identifier (hyphens, spaces, leading digits)
Enhancement
AddGeneratedMaps() is always generated — even before any [ShellMap] attributes exist — so you can wire up MauiProgram.cs immediately
Enhancement
AddGeneratedMaps() now uses inline string literals instead of Routes.* constants, so it works correctly even when route constant generation is disabled
Enhancement
When no route is specified, the generated name falls back to the page type name without the Page suffix (e.g., [ShellMap<HomePage>]Routes.Home)
  • Route constant names may change if you specified explicit routes — e.g., Routes.Home for [ShellMap<HomePage>("Dashboard")] is now Routes.Dashboard
  • Navigation extension method names change similarly — NavigateToHome becomes NavigateToDashboard
  • Routes with invalid C# identifiers (hyphens, spaces, leading digits) now produce compile errors — rename them to valid identifiers