CommonHelpers.Maui
0.1.0
See the version list below for details.
dotnet add package CommonHelpers.Maui --version 0.1.0
NuGet\Install-Package CommonHelpers.Maui -Version 0.1.0
<PackageReference Include="CommonHelpers.Maui" Version="0.1.0" />
paket add CommonHelpers.Maui --version 0.1.0
#r "nuget: CommonHelpers.Maui, 0.1.0"
// Install CommonHelpers.Maui as a Cake Addin #addin nuget:?package=CommonHelpers.Maui&version=0.1.0 // Install CommonHelpers.Maui as a Cake Tool #tool nuget:?package=CommonHelpers.Maui&version=0.1.0
CommonHelpers.Maui
This is a library containing some commonly needed helpers. The goal is to build on top of the more popular CommonHelpers package, but with .NET MAUI specialized functionality.
App Extensions
Extensions for platform-specific code that can be used in MauiProgram.cs.
- For WinUI
window.TryMicaOrAcrylic();
- For MacCatalyst
windowScene.RestrictWindowMinimumSize(new CGSize(600, 400))
windowScene.RestrictWindowMaximumSize(new CGSize(1920, 1080))
windowScene.RestrictWindowSize(new CGSize(600, 400), new CGSize(1920, 1080))
#if WINDOWS10_0_17763_0_OR_GREATER
using CommonHelpers.Maui.Platforms.Windows;
#elif MACCATALYST
using CommonHelpers.Maui.Platforms.MacCatalyst;
using UIKit;
using CoreGraphics;
#endif
public static MauiApp CreateMauiApp()
{
// ... your other boiler plate startup code here
builder.ConfigureLifecycleEvents(events =>
{
#if WINDOWS10_0_17763_0_OR_GREATER
events.AddWindows(wndLifeCycleBuilder =>
{
wndLifeCycleBuilder.OnWindowCreated(window =>
{
// For automatic Mica or Acrylic support
window.TryMicaOrAcrylic();
});
});
});
#elif MACCATALYST
events.AddiOS(wndLifeCycleBuilder =>
{
wndLifeCycleBuilder.SceneWillConnect((scene, session, options) =>
{
if (scene is UIWindowScene windowScene)
{
// Can be used for restricting the MacOS window's min, max (or both) size.
windowScene.RestrictWindowMinimumSize(new CGSize(600, 400));
}
});
});
#endif
return builder.Build();
}
Behaviors
A BehaviorBase<T>
class that lets you create your own, or use the out-of-the-box EventToCommandBehavior
implementation.
Converters
There are several commonly used IValueConverter implementations:
IntToDoubleConverter
InvertBoolConverter
NullToBoolConverter
StringToUriConverter
As well as a couple boutique ones:
ConfigurableBoolConverter
NameToInitialsConverter
More to come
This is just the beginning, I plan to build this out as an indispensable comparion to the CommonHelpers library.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-android31.0 is compatible. net6.0-ios was computed. net6.0-ios16.1 is compatible. net6.0-maccatalyst was computed. net6.0-maccatalyst16.1 is compatible. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net6.0-windows10.0.19041 is compatible. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
-
net6.0-android31.0
- No dependencies.
-
net6.0-ios16.1
-
net6.0-maccatalyst16.1
-
net6.0-windows10.0.19041
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Review releases on GitHub at bit.ly/CommonHelpers