From 0c9c1edf71913c7c2f59f98a1458b99e44801c65 Mon Sep 17 00:00:00 2001 From: Allan Ritchie Date: Tue, 4 Jun 2024 23:00:16 -0400 Subject: [PATCH] Bugfixes & support for shiny mediator, cardsview.maui, & plugin.maui.ocr --- .../ShinyApp/.template.config/ide.host.json | 38 ++++++++++++++++--- .../ShinyApp/.template.config/template.json | 22 ++++++++++- ProjectTemplates/ShinyApp/BlazorPage.xaml | 2 +- .../ShinyApp/{ => Components}/Routes.razor | 0 .../ShinyApp/{ => Components}/_Imports.razor | 0 ProjectTemplates/ShinyApp/Documentation.md | 24 ++++++++++++ ProjectTemplates/ShinyApp/MauiProgram.cs | 26 ++++++++++++- ProjectTemplates/ShinyApp/ShinyApp.csproj | 23 ++++++++--- README.md | 7 +++- Template.csproj | 2 +- 10 files changed, 127 insertions(+), 17 deletions(-) rename ProjectTemplates/ShinyApp/{ => Components}/Routes.razor (100%) rename ProjectTemplates/ShinyApp/{ => Components}/_Imports.razor (100%) diff --git a/ProjectTemplates/ShinyApp/.template.config/ide.host.json b/ProjectTemplates/ShinyApp/.template.config/ide.host.json index 41de111..e6be2e5 100644 --- a/ProjectTemplates/ShinyApp/.template.config/ide.host.json +++ b/ProjectTemplates/ShinyApp/.template.config/ide.host.json @@ -12,12 +12,19 @@ }], "symbolInfo": [ { - "id": "markuptype", - "name": { - "text": "UI Markup Type" + "id": "useblazor", + "name":{ + "text": "Add Blazor Hybrid Support" + }, + "isVisible": true + }, + { + "id": "usecsharpmarkup", + "name":{ + "text": "Add C# Markup - MAUI Community Toolkit" }, "isVisible": true - }, + }, { "id": "applicationId", "name": { @@ -32,6 +39,13 @@ }, "isVisible": true }, + { + "id": "shinymediator", + "name": { + "text": "Add Shiny Mediator" + }, + "isVisible": true + }, { "id": "configuration", "name": { @@ -258,6 +272,13 @@ }, "isVisible": true }, + { + "id": "cards", + "name":{ + "text": "Add CardsView.Maui" + }, + "isVisible": true + }, { "id": "sqlite", "name": { @@ -292,8 +313,7 @@ "text": "Add Calendar Store (Plugin.Maui.CalendarStore)" }, "isVisible": true - }, - { + },{ "id": "audio", "name":{ "text": "Add Audio (Plugin.Maui.Audio)" @@ -305,6 +325,12 @@ "text": "Add Screen Recording (Plugin.Maui.ScreenRecording)" }, "isVisible": true + },{ + "id": "ocr", + "name":{ + "text": "Add OCR (Plugin.Maui.OCR)" + }, + "isVisible": true },{ "id": "userdialogs", "name":{ diff --git a/ProjectTemplates/ShinyApp/.template.config/template.json b/ProjectTemplates/ShinyApp/.template.config/template.json index 118107d..fe1028c 100644 --- a/ProjectTemplates/ShinyApp/.template.config/template.json +++ b/ProjectTemplates/ShinyApp/.template.config/template.json @@ -116,6 +116,13 @@ "description": "Add Shiny Framework by Allan Ritchie - Documentation https://github.com/shinyorg/framework - Lots of helpful services like navigation, zero boilerplate MVVM properties, viewmodel validation, localization, viewmodel lifecycles, dialog services, and more", "displayName": "Add Shiny Framework (Shiny + ReactiveUI + Prism)" }, + "shinymediator":{ + "type": "parameter", + "datatype": "bool", + "defaultValue": "true", + "description": "Add Shiny Mediator - Documentation https://github.com/shinyorg/mediator", + "displayName": "Add Shiny Mediator" + }, "localization":{ "type": "parameter", "datatype": "bool", @@ -387,6 +394,13 @@ "description": "Sharpnado Tabs by Jean-Marie Alfonsi - Documentation https://github.com/roubachof/Sharpnado.Tabs", "displayName": "Add Sharpnado Tabs" }, + "cards":{ + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "description": "CardsView.Maui by Andrei Misiukevich - Documentation https://www.nuget.org/packages/CardsView.Maui", + "displayName": "Add CardsView.Maui" + }, "sqlite": { "type": "parameter", "datatype": "bool", @@ -429,6 +443,13 @@ "description": "Audio Plugin by Gerald Versluis - Documentation https://github.com/jfversluis/Plugin.Maui.Audio", "displayName": "Add Audio (Plugin.Maui.Audio)" }, + "ocr":{ + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "description": "OCR Plugin by Kori Francis - Documentation https://github.com/kfrancis/ocr", + "displayName": "Add OCR (Plugin.Maui.OCR)" + }, "screenrecord":{ "type": "parameter", "datatype": "bool", @@ -732,7 +753,6 @@ "condition": "(useblazor == false)", "exclude":[ "BlazorPage.*", - "*.razor", "Components/**", "wwwroot/**" ] diff --git a/ProjectTemplates/ShinyApp/BlazorPage.xaml b/ProjectTemplates/ShinyApp/BlazorPage.xaml index 5b41fe3..070e16a 100644 --- a/ProjectTemplates/ShinyApp/BlazorPage.xaml +++ b/ProjectTemplates/ShinyApp/BlazorPage.xaml @@ -1,7 +1,7 @@  diff --git a/ProjectTemplates/ShinyApp/Routes.razor b/ProjectTemplates/ShinyApp/Components/Routes.razor similarity index 100% rename from ProjectTemplates/ShinyApp/Routes.razor rename to ProjectTemplates/ShinyApp/Components/Routes.razor diff --git a/ProjectTemplates/ShinyApp/_Imports.razor b/ProjectTemplates/ShinyApp/Components/_Imports.razor similarity index 100% rename from ProjectTemplates/ShinyApp/_Imports.razor rename to ProjectTemplates/ShinyApp/Components/_Imports.razor diff --git a/ProjectTemplates/ShinyApp/Documentation.md b/ProjectTemplates/ShinyApp/Documentation.md index a56e250..6bd0d8e 100644 --- a/ProjectTemplates/ShinyApp/Documentation.md +++ b/ProjectTemplates/ShinyApp/Documentation.md @@ -25,6 +25,14 @@ _A cross platform framework designed to make working with device services and ba * [Documentation](https://shinylib.net/) * [GitHub](https://github.com/shinyorg/shiny) + +## Shiny Mediator + +_A simple mediator pattern for .NET applications - Written by Allan Ritchie_ + +* [GitHub](https://github.com/shinyorg/mediator) + + ## Sentry for MAUI * Easy MAUI integration by calling UseSentry on your MauiAppBuilder @@ -110,6 +118,14 @@ _A performant and feature rich collection view by Jean-Marie Alfonsi_ * [GitHub](https://github.com/roubachof/Sharpnado.CollectionView) + + +## CardsView MAUI + +_CardsView is a view for presenting a stack of cards in a carousel-like view. It supports swiping to dismiss, dragging and dropping, and more. - Written by Andrei Misiukevich_ + +* [GitHub](https://github.com/AndreiMisiukevich/CardView.MAUI) + ## .NET MAUI Maps @@ -204,6 +220,14 @@ _Provides the ability to record the screen from within your .NET MAUI app - Writ * [GitHub](https://github.com/jfversluis/Plugin.Maui.ScreenRecording) + + +## MAUI OCR Plugin + +_Provides the ability to perform OCR (Optical Character Recognition) on images in your .NET MAUI app - Written by Kori Francis_ + +* [GitHub](https://github.com/kfrancis/ocr) + ## MAUI Biometric Plugin diff --git a/ProjectTemplates/ShinyApp/MauiProgram.cs b/ProjectTemplates/ShinyApp/MauiProgram.cs index ac7283c..09c8eb0 100644 --- a/ProjectTemplates/ShinyApp/MauiProgram.cs +++ b/ProjectTemplates/ShinyApp/MauiProgram.cs @@ -1,9 +1,15 @@ -#if debugrainbows +#if shinymediator +using Shiny.Mediator; +#endif +#if debugrainbows using Plugin.Maui.DebugRainbows; #endif #if screenrecord using Plugin.Maui.ScreenRecording; #endif +#if ocr +using Plugin.Maui.OCR; +#endif #if fingerprint using Maui.Biometric; #endif @@ -22,6 +28,9 @@ #if sharpnadotabs using Sharpnado.Tabs; #endif +#if cards +using PanCardView; +#endif #if skia || skiaextended using SkiaSharp.Views.Maui.Controls.Hosting; #endif @@ -103,6 +112,9 @@ public static MauiApp CreateMauiApp() => MauiApp #if usemauimaps .UseMauiMaps() #endif +#if cards + .UseCardsView() +#endif #if sentry .UseSentry(options => { @@ -155,6 +167,9 @@ public static MauiApp CreateMauiApp() => MauiApp ) #endif //+:cnd:noEmit +#endif +#if ocr + .UseOcr() #endif .ConfigureFonts(fonts => { @@ -199,6 +214,15 @@ static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder) #endif //+:cnd:noEmit var s = builder.Services; +#if shinymediator + s.AddShinyMediator(cfg => + { + cfg.UseMaui(); +#if useblazor + cfg.UseBlazor(); +#endif + }); +#endif #if appaction s.AddSingleton(); #endif diff --git a/ProjectTemplates/ShinyApp/ShinyApp.csproj b/ProjectTemplates/ShinyApp/ShinyApp.csproj index 0fe4928..265eab9 100644 --- a/ProjectTemplates/ShinyApp/ShinyApp.csproj +++ b/ProjectTemplates/ShinyApp/ShinyApp.csproj @@ -11,7 +11,7 @@ False - 8.0.21 + 8.0.40 Exe ShinyApp true @@ -145,6 +145,9 @@ + + + @@ -159,9 +162,6 @@ - - - @@ -173,6 +173,13 @@ + + + + + + + @@ -239,6 +246,9 @@ + + + @@ -254,6 +264,9 @@ + + + @@ -278,7 +291,7 @@ - + diff --git a/README.md b/README.md index 896e022..ede4c98 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ #### MAUI Shiny.NET App Project Template -* Supports Visual Studio for Windows 2022 and Visual Studio for Mac 2022 +* Supports Visual Studio for Windows 2022, Visual Studio for Mac 2022, & JetBrains Rider 2024+ * Creates all the necessary permissions, boilerplate, & setup you'll need to get your .NET MAUI app up and running with Shiny & many other great community libraries * Easy setup and choice for push notifications * Full Native @@ -25,6 +25,7 @@ * [Prism](https://prismlibrary.com/) * [ReactiveUI](https://reactiveui.net/) * [Shiny.NET](https://shinylib.net) + * [Shiny Mediator](https://github.com/shinyorg/mediator) * Select mutliple platform UI Markup types * XAML * Blazor @@ -70,8 +71,10 @@ * [In-App Billing Plugin](https://github.com/jamesmontemagno/InAppBillingPlugin) by James Montemagno * [MAUI Screen Recording Plugin](https://github.com/jfversluis/Plugin.Maui.ScreenRecording) by Gerald Versluis * [MAUI Audio Plugin](https://github.com/jfversluis/Plugin.Maui.Audio) by Gerald Versluis - * [MAUI Calendar Store Plugin](https://github.com/jfversluis/Plugin.Maui.CalendarStore) by Gerald Versluis + * [MAUI Calendar Store Plugin](https://github.com/jfversluis/Plugin.Maui.CalendarStore) by Gerald Versluis + * [MAUI OCR Plugin](https://github.com/kfrancis/ocr) by Kori Francis * [MAUI Biometric Plugin](https://github.com/oscoreio/Maui.Biometric) by Konstantin S & Sven-Michael Stübe + * [CardsView MAUI](https://github.com/AndreiMisiukevich/CardView.MAUI) by Andrei Misiukevich * [Drastic Flipper](https://github.com/drasticactions/Drastic.Flipper) by Tim Miller * [Embed.IO](https://unosquare.github.io/embedio/) by Unosquare * [SkiaSharp](https://github.com/mono/SkiaSharp) by Matthew Leibowitz diff --git a/Template.csproj b/Template.csproj index 6358dba..c78035e 100644 --- a/Template.csproj +++ b/Template.csproj @@ -3,7 +3,7 @@ Shiny.NET Templates - One stop shop to setup almost everything you can imagine within your .NET MAUI application Template - 2.8.0 + 2.9.0 Shiny.Templates Shiny Templates Allan Ritchie