From 05fac5126a019381e72acc5762fc087a62186a31 Mon Sep 17 00:00:00 2001 From: Vijay Anand E G <81947404+egvijayanand@users.noreply.github.com> Date: Mon, 7 Mar 2022 13:22:39 +0530 Subject: [PATCH 1/2] Initial release of VijayAnand.MauiToolkit.* NuGet packages --- .../CorePackageName.txt | 1 + .../Create-Debug-Package.bat | 5 + src/VijayAnand.MauiToolkit/Create-Package.bat | 60 ++++++++++ .../Create-Release-Package.bat | 5 + src/VijayAnand.MauiToolkit/PackageVersion.txt | 1 + .../Push-Release-Package.bat | 67 +++++++++++ .../ToolkitPackageName.txt | 1 + .../IDialogService.cs | 13 +++ .../INavigationService.cs | 13 +++ .../IShareService.cs | 9 ++ .../VijayAnand.MauiToolkit.Core/InputType.cs | 15 +++ .../VijayAnand.MauiToolkit.Core.csproj | 49 ++++++++ .../VijayAnand.MauiToolkit.Core/overview.md | 15 +++ .../release-notes.txt | 13 +++ .../VijayAnand.MauiToolkit.sln | 28 +++++ .../VijayAnand.MauiToolkit/DialogService.cs | 108 ++++++++++++++++++ .../IMauiDialogService.cs | 13 +++ .../VijayAnand.MauiToolkit/Imports.cs | 5 + .../MauiAppBuilderExtensions.cs | 14 +++ .../NavigationService.cs | 45 ++++++++ .../VijayAnand.MauiToolkit/ShareService.cs | 29 +++++ .../VijayAnand.MauiToolkit.csproj | 71 ++++++++++++ .../VijayAnand.MauiToolkit/overview.md | 33 ++++++ .../VijayAnand.MauiToolkit/release-notes.txt | 28 +++++ 24 files changed, 641 insertions(+) create mode 100644 src/VijayAnand.MauiToolkit/CorePackageName.txt create mode 100644 src/VijayAnand.MauiToolkit/Create-Debug-Package.bat create mode 100644 src/VijayAnand.MauiToolkit/Create-Package.bat create mode 100644 src/VijayAnand.MauiToolkit/Create-Release-Package.bat create mode 100644 src/VijayAnand.MauiToolkit/PackageVersion.txt create mode 100644 src/VijayAnand.MauiToolkit/Push-Release-Package.bat create mode 100644 src/VijayAnand.MauiToolkit/ToolkitPackageName.txt create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/IDialogService.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/INavigationService.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/IShareService.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/InputType.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/VijayAnand.MauiToolkit.Core.csproj create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/overview.md create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/release-notes.txt create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.sln create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/DialogService.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/IMauiDialogService.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/Imports.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/MauiAppBuilderExtensions.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/NavigationService.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/ShareService.cs create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.csproj create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/overview.md create mode 100644 src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/release-notes.txt diff --git a/src/VijayAnand.MauiToolkit/CorePackageName.txt b/src/VijayAnand.MauiToolkit/CorePackageName.txt new file mode 100644 index 0000000..63b7699 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/CorePackageName.txt @@ -0,0 +1 @@ +VijayAnand.MauiToolkit.Core diff --git a/src/VijayAnand.MauiToolkit/Create-Debug-Package.bat b/src/VijayAnand.MauiToolkit/Create-Debug-Package.bat new file mode 100644 index 0000000..f3ff91e --- /dev/null +++ b/src/VijayAnand.MauiToolkit/Create-Debug-Package.bat @@ -0,0 +1,5 @@ +:: Creates a new NuGet package from the project file in Debug configuration +@echo off + +call Create-Package.bat Debug +pause diff --git a/src/VijayAnand.MauiToolkit/Create-Package.bat b/src/VijayAnand.MauiToolkit/Create-Package.bat new file mode 100644 index 0000000..cf1c8f0 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/Create-Package.bat @@ -0,0 +1,60 @@ +:: Creates a new NuGet package from the project file +@echo off + +if [%1]==[] (call Error "Build configuration input is not provided." & goto end) + +set config=%1 + +:: Package Name + +if not exist CorePackageName.txt (call Error "Core package name file not available." & goto end) + +set /P corePkgName= DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons); + + Task DisplayAlert(string title, string message, string cancel); + + Task DisplayAlert(string title, string message, string accept, string cancel); + + Task DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string? placeholder = null, int maxLength = -1, InputType inputType = InputType.Default, string initialValue = ""); + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/INavigationService.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/INavigationService.cs new file mode 100644 index 0000000..0b813ea --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/INavigationService.cs @@ -0,0 +1,13 @@ +namespace VijayAnand.MauiToolkit.Core +{ + public interface INavigationService + { + Task GoToAsync(string uri); + + Task GoToAsync(string uri, string key, string value); + + Task GoToAsync(string uri, Dictionary parameters); + + Task GoBackAsync(bool modal = false); + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/IShareService.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/IShareService.cs new file mode 100644 index 0000000..427b3ac --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/IShareService.cs @@ -0,0 +1,9 @@ +namespace VijayAnand.MauiToolkit.Core +{ + public interface IShareService + { + Task ShareText(string title, string text); + + Task ShareUri(string title, string text, string uri); + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/InputType.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/InputType.cs new file mode 100644 index 0000000..6a83356 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/InputType.cs @@ -0,0 +1,15 @@ +namespace VijayAnand.MauiToolkit.Core +{ + public enum InputType + { + Plain, + Chat, + Decimal, + Default, + Email, + Numeric, + Telephone, + Text, + Url + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/VijayAnand.MauiToolkit.Core.csproj b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/VijayAnand.MauiToolkit.Core.csproj new file mode 100644 index 0000000..5f31a02 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/VijayAnand.MauiToolkit.Core.csproj @@ -0,0 +1,49 @@ + + + + net6.0 + + + enable + enable + VijayAnand.MauiToolkit.Core + + + true + VijayAnand.MauiToolkit.Core + Vijay Anand E G + Copyright © 2022 Vijay Anand E G + VijayAnand.MauiToolkit.Core is a set of helper methods and classes to simplify working with .NET MAUI (and Blazor). + .NET MAUI Toolkit - Core + VijayAnand.MauiToolkit.Core is a set of helper methods and classes to simplify working with .NET MAUI (and Blazor). + MIT + https://github.com/egvijayanand/dotnet-maui-toolkit + git + .NET,MAUI,Blazor,BlazorWebView,C#,Hybrid,Toolkit,Razor,RCL,iOS,Android,macOS,WinForms,Windows,WinUI3,WPF,MacCatalyst,Server,WebAssembly,WASM + $([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/release-notes.txt")) + VijayAnand.MauiToolkit.Core + 1.0.0 + 1.0.0.0 + 1.0.0.0 + overview.md + https://egvijayanand.in/ + + + true + true + + + + true + + + + + + + + + + + + diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/overview.md b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/overview.md new file mode 100644 index 0000000..4d13a52 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/overview.md @@ -0,0 +1,15 @@ +### VijayAnand.MauiToolkit.Core + +This is a toolkit with a set of abstractions to simplify working with .NET MAUI and Blazor. + +It's built on top of .NET 6 and published as a NuGet package - [VijayAnand.MauiToolkit.Core](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/). + +The objective is to ease the development of the `Razor Class Library` (RCL) so that it can be shared with all Blazor targets (.NET MAUI, Server, WebAssembly, Windows Forms, and WPF). + +And .NET MAUI targets Android, iOS, macOS (via Mac Catalyst), and Windows (via WinUI 3). + +To start with defines the following abstractions: + +* Dialogs - `IDialogService` +* Navigation - `INavigationService` +* Share - `IShareService` diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/release-notes.txt b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/release-notes.txt new file mode 100644 index 0000000..4ca5081 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/release-notes.txt @@ -0,0 +1,13 @@ +What's new in ver. 1.0.0-pre1: + +Initial release of VijayAnand.MauiToolkit.Core NuGet package and is built on top of .NET 6. + +The objective is to ease the development of the Razor Class Library (RCL) so that it can be shared with all Blazor targets (.NET MAUI, Server, WebAssembly, Windows Forms, and WPF). + +And .NET MAUI targets Android, iOS, macOS (via Mac Catalyst), and Windows (via WinUI 3). + +To start with defines the following abstractions: + +1. Dialogs - IDialogService +2. Navigation - INavigationService +3. Share - IShareService diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.sln b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.sln new file mode 100644 index 0000000..9b3914e --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30114.105 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VijayAnand.MauiToolkit", "VijayAnand.MauiToolkit\VijayAnand.MauiToolkit.csproj", "{8384E7C5-B193-4915-A493-7488B92DF85C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VijayAnand.MauiToolkit.Core", "VijayAnand.MauiToolkit.Core\VijayAnand.MauiToolkit.Core.csproj", "{AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8384E7C5-B193-4915-A493-7488B92DF85C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8384E7C5-B193-4915-A493-7488B92DF85C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8384E7C5-B193-4915-A493-7488B92DF85C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8384E7C5-B193-4915-A493-7488B92DF85C}.Release|Any CPU.Build.0 = Release|Any CPU + {AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/DialogService.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/DialogService.cs new file mode 100644 index 0000000..0208fa6 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/DialogService.cs @@ -0,0 +1,108 @@ +namespace VijayAnand.MauiToolkit +{ + public class DialogService : IMauiDialogService, IDialogService + { + public Task DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons) + { + if (Application.Current.MainPage is Shell) + { + return Shell.Current.DisplayActionSheet(title, cancel, destruction, buttons); + } + else + { + return Application.Current.MainPage.DisplayActionSheet(title, cancel, destruction, buttons); + } + } + + public Task DisplayActionSheet(string title, string cancel, string destruction, FlowDirection flowDirection, params string[] buttons) + { + if (Application.Current.MainPage is Shell) + { + return Shell.Current.DisplayActionSheet(title, cancel, destruction, flowDirection, buttons); + } + else + { + return Application.Current.MainPage.DisplayActionSheet(title, cancel, destruction, flowDirection, buttons); + } + } + + public async Task DisplayAlert(string title, string message, string cancel) + { + if (Application.Current.MainPage is Shell) + { + await Shell.Current.DisplayAlert(title, message, cancel); + } + else + { + await Application.Current.MainPage.DisplayAlert(title, message, cancel); + } + } + + public Task DisplayAlert(string title, string message, string accept, string cancel) + { + if (Application.Current.MainPage is Shell) + { + return Shell.Current.DisplayAlert(title, message, accept, cancel); + } + else + { + return Application.Current.MainPage.DisplayAlert(title, message, accept, cancel); + } + } + + public async Task DisplayAlert(string title, string message, string cancel, FlowDirection flowDirection) + { + if (Application.Current.MainPage is Shell) + { + await Shell.Current.DisplayAlert(title, message, cancel, flowDirection); + } + else + { + await Application.Current.MainPage.DisplayAlert(title, message, cancel, flowDirection); + } + } + + public Task DisplayAlert(string title, string message, string accept, string cancel, FlowDirection flowDirection) + { + if (Application.Current.MainPage is Shell) + { + return Shell.Current.DisplayAlert(title, message, accept, cancel, flowDirection); + } + else + { + return Application.Current.MainPage.DisplayAlert(title, message, accept, cancel, flowDirection); + } + } + + public Task DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string? placeholder = null, int maxLength = -1, Keyboard? keyboard = null, string initialValue = "") + { + if (Application.Current.MainPage is Shell) + { + return Shell.Current.DisplayPromptAsync(title, message, accept, cancel, placeholder, maxLength, keyboard, initialValue); + } + else + { + return Application.Current.MainPage.DisplayPromptAsync(title, message, accept, cancel, placeholder, maxLength, keyboard, initialValue); + } + } + + public Task DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string? placeholder = null, int maxLength = -1, InputType inputType = InputType.Default, string initialValue = "") + { + var keyboard = inputType switch + { + InputType.Plain => Keyboard.Plain, + InputType.Chat => Keyboard.Chat, + InputType.Decimal => Keyboard.Numeric, + InputType.Default => Keyboard.Default, + InputType.Email => Keyboard.Email, + InputType.Numeric => Keyboard.Numeric, + InputType.Telephone => Keyboard.Telephone, + InputType.Text => Keyboard.Text, + InputType.Url => Keyboard.Url, + _ => Keyboard.Default + }; + + return DisplayPromptAsync(title, message, accept, cancel, placeholder, maxLength, keyboard, initialValue); + } + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/IMauiDialogService.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/IMauiDialogService.cs new file mode 100644 index 0000000..3238bfa --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/IMauiDialogService.cs @@ -0,0 +1,13 @@ +namespace VijayAnand.MauiToolkit +{ + public interface IMauiDialogService : IDialogService + { + Task DisplayActionSheet(string title, string cancel, string destruction, FlowDirection flowDirection, params string[] buttons); + + Task DisplayAlert(string title, string message, string cancel, FlowDirection flowDirection); + + Task DisplayAlert(string title, string message, string accept, string cancel, FlowDirection flowDirection); + + Task DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string? placeholder = null, int maxLength = -1, Keyboard? keyboard = null, string initialValue = ""); + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/Imports.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/Imports.cs new file mode 100644 index 0000000..4d50e34 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/Imports.cs @@ -0,0 +1,5 @@ +// Project reference +global using VijayAnand.MauiToolkit.Core; + +// Static +global using static Microsoft.Maui.Graphics.Colors; diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/MauiAppBuilderExtensions.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/MauiAppBuilderExtensions.cs new file mode 100644 index 0000000..9d5c843 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/MauiAppBuilderExtensions.cs @@ -0,0 +1,14 @@ +namespace VijayAnand.MauiToolkit +{ + public static class MauiAppBuilderExtensions + { + public static MauiAppBuilder UseVijayAnandMauiToolkit(this MauiAppBuilder builder) + { + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + return builder; + } + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/NavigationService.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/NavigationService.cs new file mode 100644 index 0000000..fb83562 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/NavigationService.cs @@ -0,0 +1,45 @@ +using System.Text; + +namespace VijayAnand.MauiToolkit +{ + public class NavigationService : INavigationService + { + public async Task GoToAsync(string uri) + { + await Shell.Current.GoToAsync(uri); + } + + public async Task GoToAsync(string uri, string key, string value) + { + await Shell.Current.GoToAsync($"{uri}?{key}={value}"); + } + + public async Task GoToAsync(string uri, Dictionary parameters) + { + await Shell.Current.GoToAsync(BuildUri(uri, parameters)); + } + + public async Task GoBackAsync(bool modal = false) + { + if (modal) + { + if (Shell.Current.Navigation.ModalStack.Count > 0) + { + await Shell.Current.Navigation.PopModalAsync(); + } + } + else + { + await Shell.Current.Navigation.PopAsync(); + } + } + + private static string BuildUri(string uri, Dictionary parameters) + { + var fullUrl = new StringBuilder(uri); + fullUrl.Append('?'); + fullUrl.Append(string.Join("&", parameters.Select(item => $"{item.Key}={item.Value}"))); + return fullUrl.ToString(); + } + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/ShareService.cs b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/ShareService.cs new file mode 100644 index 0000000..f0e880e --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/ShareService.cs @@ -0,0 +1,29 @@ +namespace VijayAnand.MauiToolkit +{ + public class ShareService : IShareService + { + public async Task ShareText(string title, string text) + { + try + { + await Share.RequestAsync(new ShareTextRequest(text, title)); + } + catch + { + throw; + } + } + + public async Task ShareUri(string title, string text, string uri) + { + try + { + await Share.RequestAsync(new ShareTextRequest() { Title = $"{title} - {text}", Uri = uri }); + } + catch + { + throw; + } + } + } +} diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.csproj b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.csproj new file mode 100644 index 0000000..0dafbe7 --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.csproj @@ -0,0 +1,71 @@ + + + net6.0;net6.0-android + + $(TargetFrameworks);net6.0-ios;net6.0-maccatalyst;net6.0-windows10.0.19041 + + $(TargetFrameworks);net6.0-ios;net6.0-maccatalyst + + + true + true + + + enable + enable + VijayAnand.MauiToolkit + + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + + + 10.0.17763.0 + + + true + VijayAnand.MauiToolkit + Vijay Anand E G + Copyright © 2022 Vijay Anand E G + VijayAnand.MauiToolkit is a set of helper methods and classes to simplify working with .NET MAUI (and Blazor). + .NET MAUI Toolkit + VijayAnand.MauiToolkit is a set of helper methods and classes to simplify working with .NET MAUI (and Blazor). + MIT + https://github.com/egvijayanand/dotnet-maui-toolkit + git + .NET,MAUI,Blazor,BlazorWebView,C#,Hybrid,Toolkit,Razor,RCL,iOS,Android,macOS,Windows,WinUI3,MacCatalyst + $([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/release-notes.txt")) + VijayAnand.MauiToolkit + 1.0.0 + 1.0.0.0 + 1.0.0.0 + overview.md + https://egvijayanand.in/ + + + true + true + embedded + true + snupkg + + + + true + + + + + + + + + + + + + + + diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/overview.md b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/overview.md new file mode 100644 index 0000000..5ba23cf --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/overview.md @@ -0,0 +1,33 @@ +### VijayAnand.MauiToolkit + +This is a toolkit with a set of helper methods and classes to simplify working with .NET MAUI and Blazor. + +Published as a NuGet package - [VijayAnand.MauiToolkit](https://www.nuget.org/packages/VijayAnand.MauiToolkit/) + +It depends on [VijayAnand.MauiToolkit.Core](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/) NuGet package. + +To start with, implements the concrete definition of the abstractions defined in Core package: + +* Dialogs - `DialogService` (works with MainPage or Shell definition) + - Additional abstraction specific to .NET MAUI with `FlowDirection` +* Navigation - `NavigationService` (based on Shell Navigation pattern) +* Share - `ShareService` (based on Maui Essentials) + +Most importantly, provides the below method to register these services in .NET MAUI host builder startup: + +`UseVijayAnandMauiToolkit()` + +Usage: + +```cs +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder.UseMauiApp() + .UseVijayAnandMauiToolkit(); + return builder.Build(); + } +} +``` diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/release-notes.txt b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/release-notes.txt new file mode 100644 index 0000000..380474f --- /dev/null +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/release-notes.txt @@ -0,0 +1,28 @@ +What's new in ver. 1.0.0-pre1: + +Initial release of VijayAnand.MauiToolkit NuGet package. + +It depends on VijayAnand.MauiToolkit.Core NuGet package. + +To start with, implements the concrete definition of the abstractions defined in Core package: + +1. Dialogs - DialogService (works with MainPage or Shell definition) + + 1.1 Additional abstraction specific to .NET MAUI + +2. Navigation - NavigationService (based on Shell Navigation pattern) + +3. Share - ShareService (based on Maui Essentials) + +Most importantly, provides the below method to register these services in .NET MAUI host builder startup: + +UseVijayAnandMauiToolkit() + +Usage: + +public static MauiApp CreateMauiApp() +{ + var builder = MauiApp.CreateBuilder(); + builder.UseMauiApp().UseVijayAnandMauiToolkit(); + return builder.Build(); +} From 2d16f009c580a15b5a138d809a051464aafddfde Mon Sep 17 00:00:00 2001 From: Vijay Anand E G <81947404+egvijayanand@users.noreply.github.com> Date: Mon, 7 Mar 2022 13:33:45 +0530 Subject: [PATCH 2/2] Documentation changes and Workspace file --- README.md | 52 ++++++++++++++++++- dotnet-maui-toolkit.code-workspace | 8 +++ .../VijayAnand.MauiToolkit/overview.md | 2 +- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 dotnet-maui-toolkit.code-workspace diff --git a/README.md b/README.md index 3f0f6e3..807a37a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,54 @@ -### .NET MAUI Blazor Toolkit +### VijayAnand.MauiToolkit.Core + +This is a toolkit with a set of abstractions to simplify working with .NET MAUI and Blazor. + +It's built on top of .NET 6 and published as a NuGet package - [![VijayAnand.MauiToolkit.Core - NuGet Package](https://badgen.net/nuget/v/VijayAnand.MauiToolkit.Core/)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/) + +The objective is to ease the development of the `Razor Class Library` (RCL) so that it can be shared with all Blazor targets (.NET MAUI, Server, WebAssembly, Windows Forms, and WPF). + +And .NET MAUI targets Android, iOS, macOS (via Mac Catalyst), and Windows (via WinUI 3). + +To start with defines the following abstractions: + +* Dialogs - `IDialogService` +* Navigation - `INavigationService` +* Share - `IShareService` + +### VijayAnand.MauiToolkit + +This is a toolkit with a set of helper methods and classes to simplify working with .NET MAUI and Blazor. + +Published as a NuGet package - [![VijayAnand.MauiToolkit - NuGet Package](https://badgen.net/nuget/v/VijayAnand.MauiToolkit/)](https://www.nuget.org/packages/VijayAnand.MauiToolkit/) + +It depends on [VijayAnand.MauiToolkit.Core](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/) NuGet package. + +To start with, implements the concrete definition of the abstractions defined in Core package: + +* Dialogs - `DialogService` (works with MainPage or Shell definition) + - Additional abstraction specific to .NET MAUI with `FlowDirection` +* Navigation - `NavigationService` (based on Shell Navigation pattern) +* Share - `ShareService` (based on Maui Essentials) + +Most importantly, provides an extension method to register these services in .NET MAUI host builder startup: + +`UseVijayAnandMauiToolkit()` + +Usage: + +```cs +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder.UseMauiApp() + .UseVijayAnandMauiToolkit(); + return builder.Build(); + } +} +``` + +### VijayAnand.MauiBlazor.Markup This toolkit a set of fluent helper methods and classes to simplify working with .NET MAUI Blazor in C#. diff --git a/dotnet-maui-toolkit.code-workspace b/dotnet-maui-toolkit.code-workspace new file mode 100644 index 0000000..876a149 --- /dev/null +++ b/dotnet-maui-toolkit.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": {} +} \ No newline at end of file diff --git a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/overview.md b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/overview.md index 5ba23cf..1f495f4 100644 --- a/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/overview.md +++ b/src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/overview.md @@ -13,7 +13,7 @@ To start with, implements the concrete definition of the abstractions defined in * Navigation - `NavigationService` (based on Shell Navigation pattern) * Share - `ShareService` (based on Maui Essentials) -Most importantly, provides the below method to register these services in .NET MAUI host builder startup: +Most importantly, provides an extension method to register these services in .NET MAUI host builder startup: `UseVijayAnandMauiToolkit()`