Skip to content

Commit

Permalink
Merge pull request #123 from egvijayanand/working
Browse files Browse the repository at this point in the history
MAUI Blazor Markup package updated to support .NET MAUI 9
  • Loading branch information
egvijayanand authored Nov 15, 2024
2 parents 1604968 + 8b9128f commit 7eef6c4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 18 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Join me on [**Developer Thoughts**](https://egvijayanand.in/), an exclusive blog
|Channel|.NET 8|.NET 9|
|:---:|:---:|:---:|
|Stable|[![.NET 8](https://badgen.net/badge/nuget/v3.5.0/blue?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/3.5.0)|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.Toolkit.Markup/?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/)|
<!--|Preview|-|-|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.Toolkit.Markup/pre?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/absoluteLatest)|-->
<!--|Preview|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.Toolkit.Markup/pre?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/absoluteLatest)|-->

<!--|[VijayAnand.Toolkit.Markup](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/)|.NET 6|.NET 7|.NET 8|.NET 9|
|:---:|:---:|:---:|:---:|:---:|
Expand Down Expand Up @@ -146,14 +146,19 @@ public static class MauiProgram

### VijayAnand.MauiBlazor.Markup

This toolkit is a set of fluent helper methods and classes to simplify working with .NET MAUI Blazor in C#.
This [markup](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/) package is a set of fluent helper methods and classes to simplify working with .NET MAUI Blazor in C#.

This toolkit depends on [Microsoft.AspNetCore.Components.WebView.Maui](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebView.Maui) NuGet package.
It depends on the [Microsoft.AspNetCore.Components.WebView.Maui](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebView.Maui) NuGet package.

|[VijayAnand.MauiBlazor.Markup](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/)|.NET 6|.NET 7|.NET 8|.NET 9|
|Channel|.NET 8|.NET 9|
|:---:|:---:|:---:|
|Stable|[![.NET 8](https://badgen.net/badge/nuget/v3.0.8/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/3.0.8)|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup)|
<!--|Preview|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup/latest?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/absoluteLatest)|-->

<!--|[VijayAnand.MauiBlazor.Markup](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/)|.NET 6|.NET 7|.NET 8|.NET 9|
|:---:|:---:|:---:|:---:|:---:|
|Stable|[![.NET 6](https://badgen.net/badge/nuget/v1.0.12/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/1.0.12)|[![.NET 7](https://badgen.net/badge/nuget/v2.0.10/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/2.0.10)|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup)|-|
|Preview|-|-|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup/latest?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/absoluteLatest)|
|Preview|-|-|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup/latest?icon=nuget&foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/absoluteLatest)|-->

The most useful method will be `Configure`, which can be invoked on an instance of a BlazorWebView and its derivatives, and it simplifies the initialization of BlazorWebView into a single fluent method call as shown in the below sample.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<!-- .NET MAUI Options -->
<UseMaui>true</UseMaui>
<MauiVersion>9.0.0</MauiVersion>
<SingleProject>true</SingleProject>

<!-- Project Options -->
Expand Down Expand Up @@ -47,7 +48,7 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<!-- <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" /> -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 11 additions & 7 deletions src/MauiBlazor.Markup/MauiBlazor.Markup/overview.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### .NET MAUI Blazor Toolkit

This toolkit a set of fluent helper methods and classes to simplify working with .NET MAUI Blazor in C#.
This [markup](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/) package is a set of fluent helper methods and classes to simplify working with .NET MAUI Blazor in C#.

This toolkit depends on [Microsoft.AspNetCore.Components.WebView.Maui](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebView.Maui) NuGet package.
It depends on the [Microsoft.AspNetCore.Components.WebView.Maui](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebView.Maui) NuGet package.

Most useful method will be `Configure`, which can be invoked on an instance of a BlazorWebView and its derivatives, and it simplifies the initialization of BlazorWebView into a single fluent method call as shown in the below sample.
The most useful method will be `Configure`, which can be invoked on an instance of a BlazorWebView and its derivatives, and it simplifies the initialization of BlazorWebView into a single fluent method call as shown in the below sample.

Note: `Gateway` is a `Razor` component and assumes it can receive a parameter named `Foo` as described in the sample underneath.

```csharp
```cs
namespace MyApp;

public class HomePage : ContentPage
Expand All @@ -17,22 +17,26 @@ public class HomePage : ContentPage
{
// A BlazorWebView can manage multiple RootComponents, to achieve this, define another Tuple with values of that component
// The method and Tuple parameter names are shown for clarity and it's optional
// Blazor component can have initialization parameters, which can be supplied thro parameters, a dictionary of keyValues
// where key is of type string and value is of type object
// Blazor component can have initialization parameters, which can be supplied through parameters, a dictionary of keyValues
// where the key is of type string and value is of type object
// Without initialization parameters
Content = new BlazorWebView().Configure(hostPage: "wwwroot/index.html", (selector: "#app", componentType: typeof(Gateway), parameters: null));

// With optional initialization parameters
Content = new BlazorWebView().Configure(hostPage: "wwwroot/index.html", (selector: "#app", componentType: typeof(Gateway), parameters: new Dictionary<string, object?> { [nameof(Gateway.Foo)] = "Bar" }));

// In a much simplified form - Real intended usage
// In a simplified form - Real intended usage
// Without initialization parameters
Content = new BlazorWebView().Configure("wwwroot/index.html", ("#app", typeof(Gateway), null));
// Much more simplified, assuming hostPage is wwwroot/index.html and selector as #app
Content = new BlazorWebView().Configure(typeof(Gateway));

// With StartPath property introduced in .NET 8 or later, overloaded Configure method
// Assuming search is the page with which the app is intended to start
Content = new BlazorWebView().Configure("wwwroot/index.html", "/search", ("#app", typeof(Gateway), null));
// Much more simplified version, assuming hostPage is wwwroot/index.html and selector as #app
Content = new BlazorWebView().Configure(typeof(Gateway), "/search");

// With optional initialization parameters
Content = new BlazorWebView().Configure("wwwroot/index.html", ("#app", typeof(Gateway), new Dictionary<string, object?> { [nameof(Gateway.Foo)] = "Bar" }));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Join me on Developer Thoughts, https://egvijayanand.in/, an exclusive blog for .NET MAUI and Blazor.

What's new in ver. 4.0.0-rc.2:
------------------------------
What's new in ver. 4.0.0:
-------------------------
This version of package is built on top of .NET MAUI 9 GA (v9.0.0).

v4.0.0-rc.2:

This version of package is built on top of .NET MAUI 9 RC2 (v9.0.0-rc.2.24503.2).

4.0.0-rc.1:
Expand Down
2 changes: 1 addition & 1 deletion src/MauiBlazor.Markup/PackageVersion-Net9.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0-rc.2
4.0.0
4 changes: 2 additions & 2 deletions src/MauiBlazor.Markup/global.json.net9.bak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"allowPrerelease": true,
"allowPrerelease": false,
"rollForward": "latestMinor",
"version": "9.0.100-preview.1.24101.2"
"version": "9.0.100"
}
}

0 comments on commit 7eef6c4

Please sign in to comment.