![]() |
VOOZH | about |
dotnet add package MudraX.Blazor.Maui --version 9.0.0.5
NuGet\Install-Package MudraX.Blazor.Maui -Version 9.0.0.5
<PackageReference Include="MudraX.Blazor.Maui" Version="9.0.0.5" />
<PackageVersion Include="MudraX.Blazor.Maui" Version="9.0.0.5" />Directory.Packages.props
<PackageReference Include="MudraX.Blazor.Maui" />Project file
paket add MudraX.Blazor.Maui --version 9.0.0.5
#r "nuget: MudraX.Blazor.Maui, 9.0.0.5"
#:package MudraX.Blazor.Maui@9.0.0.5
#addin nuget:?package=MudraX.Blazor.Maui&version=9.0.0.5Install as a Cake Addin
#tool nuget:?package=MudraX.Blazor.Maui&version=9.0.0.5Install as a Cake Tool
MudraX.Blazor.Maui is a Blazor library designed to simplify the development of Maui applications by providing essential services and components. It supports features like localization, secure storage, and device information retrieval, making it a versatile tool for modern Blazor projects.
To install the library, use the following NuGet command:
Install-Package MudraX.Blazor.Maui
Add the following code to your MauiProgram.cs file to configure the services:
builder.Services.AddMudraBlazorServices(supportedCultures: ["en-US", "zh-TW"]);
supportedCultures: Specifies the cultures supported by the application. Replace "en-US" and "zh-TW" with your desired cultures.In your index.html file, set up the localization and routing:
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<link href="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.css" rel="stylesheet" />
<link href="_content/Gotho.MudBlazor.PdfViewer/mudpdf.min.css" rel="stylesheet" />
<link href="_content/MudBlazor.Markdown/MudBlazor.Markdown.min.css" rel="stylesheet" />
<link href="_content/Heron.MudCalendar/Heron.MudCalendar.min.css" rel="stylesheet" />
</head>
<body>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
<script src="_content/MudBlazor.Markdown/MudBlazor.Markdown.min.js"></script>
<script type="module" src="_content/Heron.MudCalendar/Heron.MudCalendar.min.js"></script>
</body>
Include the necessary namespaces in your Imports.razor file:
@using System.Globalization
@using Microsoft.Extensions.Localization
@using MudBlazor
@using MudBlazor.Services
@using MudBlazor.Extensions
@using MudBlazor.Extensions.Core
@using MudBlazor.Extensions.Options
@using MudExtensions
@using MudBlazorPdf
@using MudExRichTextEditor
@using Heron.MudCalendar
@using MudraX.Blazor.Core.Services
@using MudraX.Blazor.Core.Components
@using MudraX.Blazor.Core.Components.FormFields
@using MudraX.Blazor.Core.Components.Layout
@using MudraX.Blazor.Core.Components.ListViews
@using MudraX.Blazor.Maui
@using MudraX.Blazor.Maui.Components
@using MudraX.Blazor.Maui.Components.Layout
@using MudraX.Blazor.Maui.Services
Set up the main layout of your application by adding the following code to MainLayout.razor:
<ApplicationLayout>
<ApplcationBar>
</ApplcationBar>
<DrawerMenu>
</DrawerMenu>
<Body>
@Body
</Body>
</ApplicationLayout>
MudraX.Blazor.Maui provides support for localization using IStringLocalizer. This allows you to retrieve strings from resource files.
@inject IStringLocalizer<your_resource_file> Localizer
<h1>@Localizer["WelcomeString"]</h1>
YourResourceFile with the name of your resource file.Localizer["Key"] to retrieve localized strings.The ISecureStorage service allows you to securely store and retrieve data.
@inject ISecureStorage SecureStorage
@SecureStorage.SetItemAsync("key", "value")
@SecureStorage.GetItemAsync("key")
SetItemAsync to store data securely.GetItemAsync to retrieve stored data.The IPlatformFactor service provides information about the device and platform.
@inject IPlatformFactor PlatformFactor
Platform: @PlatformFactor.GetPlatform()
DeviceIdom: @PlatformFactor.GetDeviceIdom()
GetPlatform(): Returns the platform (e.g., Web, Mobile).GetDeviceIdiom(): Returns the device type (e.g., Desktop, Tablet).For more detailed examples and use cases, refer to the official documentation or explore the sample projects included in the repository.
Contributions are welcome! Please follow the guidelines outlined in the CONTRIBUTING.md file.
This project is licensed under the MIT License. See the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 3 NuGet packages that depend on MudraX.Blazor.Maui:
| Package | Downloads |
|---|---|
|
MudraX.Blazor.Jwt.Maui
MudraX Blazor JWT MAUI Library |
|
|
MudraX.Blazor.Keycloak.Maui
MudraX Blazor Keycloak MAUI Library |
|
|
MudraX.Blazor.Maui.Essentials
MudraX Blazor MAUI Essentials Library |
This package is not used by any popular GitHub repositories.