Yu-Core.MauiBlazorToolkit 1.4.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Yu-Core.MauiBlazorToolkit --version 1.4.2
                    
NuGet\Install-Package Yu-Core.MauiBlazorToolkit -Version 1.4.2
                    
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="Yu-Core.MauiBlazorToolkit" Version="1.4.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yu-Core.MauiBlazorToolkit" Version="1.4.2" />
                    
Directory.Packages.props
<PackageReference Include="Yu-Core.MauiBlazorToolkit" />
                    
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 Yu-Core.MauiBlazorToolkit --version 1.4.2
                    
#r "nuget: Yu-Core.MauiBlazorToolkit, 1.4.2"
                    
#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.
#:package Yu-Core.MauiBlazorToolkit@1.4.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Yu-Core.MauiBlazorToolkit&version=1.4.2
                    
Install as a Cake Addin
#tool nuget:?package=Yu-Core.MauiBlazorToolkit&version=1.4.2
                    
Install as a Cake Tool

MauiBlazorToolkit

English || 简体中文

The Maui Blazor toolbox encapsulates some Maui and Maui Blazor tool classes, such as changing the color of the title bar.

Imitated the .NET MAUI Community Toolkit. Thank you very much.

Start

Install Yu-Core.MauiBlazorToolkit from NuGet

To use the MauiBlazor toolkit, you need to call the extension method in the file, as shown below: MauiProgram.cs

using MauiBlazorToolKit;

public static class MauiProgram
{
	public static MauiApp CreateMauiApp()
	{
		var builder = MauiApp.CreateBuilder();
		builder
			.UseMauiApp<App>()
			// Initialize the MAUI Blazor Toolkit by adding the below line of code
			.UseMauiBlazorToolkit()
			// After initializing the MAUI Blazor Toolkit, optionally add additional fonts
			.ConfigureFonts(fonts =>
			{
				fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
				fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
			});

		// Continue initializing your .NET MAUI App here

		return builder.Build();
	}
}

TitleBarBehavior (Title Bar Color)

TitleBarBehavior allows you to customize the color and style of the device's title bar. Note that it can only be used in Windows and Mac OS. If you want to change the status bar of Android and iOS, please refer to the .NET MAUI Community Toolkit

Configuration

Modify MainPage.xaml

<ContentPage xmlns=" http://schemas.microsoft.com/dotnet/2021/maui "
			xmlns:x=" http://schemas.microsoft.com/winfx/2009/xaml "
			xmlns:mauiBlazorToolkit="clr-namespace:MauiBlazorToolkit.Behaviors;assembly=MauiBlazorToolkit"
			x:Class="MyLittleApp.MainPage">
	<ContentPage.Behaviors>
		<mauiBlazorToolkit:TitleBarBehavior TitleBarColor="#fff" TitleBarStyle="DarkContent"></mauiBlazorToolkit:TitleBarBehavior>
	</ContentPage.Behaviors>
</ContentPage>

Modify MauiProgram.cs

	var builder = MauiApp.CreateBuilder();
	builder
	.UseMauiApp<App>()
	.UseMauiBlazorToolkit(options =>
	{
		options.TitleBar = true;
	})
Using
using MauiBlazorToolKit.Platform

#if Windows || MacCatalyst
	TitleBar.SetColor(titleBarColor);
	TitleBar.SetStyle(TitleBarStyle.DarkContent);
#endif

AppStoreLauncher (opens the default app store)

AppStoreLauncher allows you to open the default app store

The appId is the ProductId of the app in Windows

The appId is the bundle ID of the app in iOS/MacCatalyst

The appId is the package name of the app in Android

Using
AppStoreLauncher.TryOpenAsync(appId);

MediaFilePicker(Media file picker)

MediaFilePicker Allow you to select one or multiple media files Note that it can only be used on Android and iOS.

Using
using MauiBlazorToolkit.Essentials

#if Android || iOS
	FileResult? photoFileResult = await MediaFilePicker.Default.PickPhotoAsync();
	FileResult? videoFileResult = await MediaFilePicker.Default.PickVideoAsync();
	IEnumerable<FileResult>? photoFileResults = await MediaFilePicker.Default.PickMultiplePhotoAsync();
	IEnumerable<FileResult>? videoFileResults = await MediaFilePicker.Default.PickMultipleVideoAsync();
#endif

AndroidFilePicker(Android file picker)

AndroidFilePicker Improvement of FilePicker in MAUI Essentials with more options for selection Note that it can only be used in Android and may be deleted in the future

Using
using MauiBlazorToolkit.Essentials

#if Android
	FileResult? fileResult = await AndroidFilePicker.Default.PickAsync();
	IEnumerable<FileResult>? fileResults = await AndroidFilePicker.Default.PickMultipleAsync();
#endif
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-ios18.0 is compatible.  net8.0-maccatalyst was computed.  net8.0-maccatalyst18.0 is compatible.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows10.0.19041 is compatible.  net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst was computed.  net9.0-maccatalyst18.0 is compatible.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows10.0.19041 is compatible.  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.
  • net8.0

    • No dependencies.
  • net8.0-android34.0

    • No dependencies.
  • net8.0-ios18.0

    • No dependencies.
  • net8.0-maccatalyst18.0

    • No dependencies.
  • net8.0-windows10.0.19041

    • No dependencies.
  • net9.0

    • No dependencies.
  • net9.0-android35.0

    • No dependencies.
  • net9.0-ios18.0

    • No dependencies.
  • net9.0-maccatalyst18.0

    • No dependencies.
  • net9.0-windows10.0.19041

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Yu-Core.MauiBlazorToolkit:

Repository Stars
Yu-Core/SwashbucklerDiary
侠客日记是一个开源、跨平台的本地日记app,使用Blazor开发,支持Android,Windows,macOS,Web,Linux。"SwashbucklerDiary" is an open source cross-platform local diary app using Blazor , support Android,Windows,macOS,Web,Linux.
Version Downloads Last Updated
1.4.6 398 3/23/2025
1.4.5 238 3/3/2025
1.4.3 199 12/18/2024
1.4.2 129 12/11/2024
1.4.0 166 11/22/2024
1.3.9 122 11/17/2024
1.3.6 238 9/20/2024
1.3.5 158 9/11/2024
1.3.1 1,662 6/1/2024
1.3.0 254 4/5/2024
1.2.8 327 12/8/2023
1.2.7 179 11/19/2023
1.2.3 576 7/7/2023
1.2.1 217 7/4/2023
1.2.0 239 7/4/2023
1.0.2 329 6/13/2023
1.0.1 253 5/22/2023
1.0.0 229 5/22/2023