Shiny.Maui.Shell 1.0.0-beta-0016

Prefix Reserved
This is a prerelease version of Shiny.Maui.Shell.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Shiny.Maui.Shell --version 1.0.0-beta-0016
                    
NuGet\Install-Package Shiny.Maui.Shell -Version 1.0.0-beta-0016
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Shiny.Maui.Shell" Version="1.0.0-beta-0016" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shiny.Maui.Shell" Version="1.0.0-beta-0016" />
                    
Directory.Packages.props
<PackageReference Include="Shiny.Maui.Shell" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Shiny.Maui.Shell --version 1.0.0-beta-0016
                    
#r "nuget: Shiny.Maui.Shell, 1.0.0-beta-0016"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Shiny.Maui.Shell&version=1.0.0-beta-0016&prerelease
                    
Install Shiny.Maui.Shell as a Cake Addin
#tool nuget:?package=Shiny.Maui.Shell&version=1.0.0-beta-0016&prerelease
                    
Install Shiny.Maui.Shell as a Cake Tool

Shiny MAUI

Work In Progress

Shell

Inspired entirely by Prism - there is nothing here that is an original idea. I wanted to build this myself and build it around Shell so I could understand the inner workings of Shell.

Features/Roadmap

  • Registration
  • ServiceScope per Page
  • Shell XAML Integration(?)
  • Navigation Service
    • Events…?
    • To Commands
    • NavigateTo(string uri, args)
    • NavigateTo<TViewModel>
      • With Strongly Typed Init
        • Should be async??
    • GoBack(args)
    • Pop To Root
    • Set Root
    • Modals/Tabs
  • Auto ViewModel Push on to page
  • Source Generation
    • Static Routes Class
    • Navigator extension methods for strongly typed navigation
    • Dependency injection source generated method
  • ViewModel lifecycle
    • Strongly Typed Navigation Args (when navigating by viewmodel - Take a look at Shiny Mediator shell for this
    • OnAppearing/OnDisappearing
    • Navigation Confirmation
    • Disposable/Destroy
    • OnNavigatedTo(args) and direction of navigation(?)
    • OnNavigatedFrom()
      • Direction pop, uri from where?

Setup

  1. Install Nuget nuget
  2. In your MauiProgram.cs, add the following
public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .UseShinyShell(x => x
                .Add<MainPage, MainViewModel>(registerRoute: false)
                .Add<AnotherPage, AnotherViewModel>("another")
            )
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
            });

#if DEBUG
        builder.Logging.SetMinimumLevel(LogLevel.Trace);
        builder.Logging.AddDebug();
#endif

        return builder.Build();
    }
}
  1. Now you can inject Shiny.INavigator into your VIewModels and navigate away

Shiny.INavigator - TODO

  • NavigateTo(string routeName)
  • NavigateTo<TViewModel>(Action<TVIewModel>)
  • GoBack(dictionary)

ViewModel Lifecycle

TODO

  • IDisposable - to permanently destroy any hooks
  • IPageLifecycleAware
  • INavigationConfirmation
  • Receive arguments on your ViewModel by implementing - IQueryAttributable

Source Generation

THIS

// INPUT
[ShellMap<MyPage>("MyRoute")]
public class MyViewModel 
{
    [ShellProperty]
    public string Arg { get; set; }
}

GENERATES ALL OF THIS FOR YOU TO PLUGIN SEAMLESSLY WITH YOUR CODE

  • Strong Typed Routes with arguments
  • Easy Dependency Injection Registration of Routes
public static class NavigationBuilderExtensions
{
    public static global::Shiny.ShinyAppBuilder AddGeneratedMaps(this global::Shiny.ShinyAppBuilder builder)
    {
        builder.Add<Sample.MyPage, Sample.MyViewModel>(Routes.My);
        return builder;
    }
}


public static class NavigationExtensions
{
    public static global::System.Threading.Tasks.Task NavigateToModal(this global::Shiny.INavigator navigator, string arg1)
    {
        return navigator.NavigateTo<Sample.ModalViewModel>(x => { x.Arg = arg; });
    }
}

public static class Routes
{
    public const string My = "MyPage";
}

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 104 6/6/2025
1.0.0-beta-0023 102 6/6/2025
1.0.0-beta-0022 113 6/3/2025
1.0.0-beta-0021 117 6/3/2025
1.0.0-beta-0020 112 6/3/2025
1.0.0-beta-0016 111 6/3/2025
1.0.0-beta-0015 114 6/3/2025
1.0.0-beta-0014 71 5/31/2025
1.0.0-beta-0013 77 5/31/2025
1.0.0-beta-0012 86 5/30/2025
1.0.0-beta-0011 115 5/29/2025
1.0.0-beta-0010 119 5/29/2025
1.0.0-beta-0009 116 5/29/2025
1.0.0-beta-0007 118 5/27/2025
1.0.0-beta-0006 118 5/27/2025