MPad.Lib
1.0.0
dotnet add package MPad.Lib --version 1.0.0
NuGet\Install-Package MPad.Lib -Version 1.0.0
<PackageReference Include="MPad.Lib" Version="1.0.0" />
paket add MPad.Lib --version 1.0.0
#r "nuget: MPad.Lib, 1.0.0"
// Install MPad.Lib as a Cake Addin #addin nuget:?package=MPad.Lib&version=1.0.0 // Install MPad.Lib as a Cake Tool #tool nuget:?package=MPad.Lib&version=1.0.0
MPad - a simple .NET MAUI joypad control
MPad is a single joystick button that can be used in .NET MAUI Android and iOS apps. It provides 3 axis measurements, a event handler and command to consume new values.
Usage
First add the package via nuget
dotnet add package MPad.Lib
Then, in MauiProgram add the UseMauiCompatibility method on CreateMauiApp method:
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.UseMauiCompatibility();
After that, create the control on .xaml page and add the following lines on Content page node:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:m="clr-namespace:MPad.Lib;assembly=MPad.Lib"
x:Class="MyApp.MainPage"
xmlns:compat="clr-namespace:Microsoft.Maui.Controls.Compatibility;assembly=Microsoft.Maui.Controls">
That's it. The control supports MVVM pattern, using the XAxis, YAxis, ZAxis properties and command binded to a view model
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-android34.0 is compatible. net8.0-ios17.5 is compatible. |
-
net8.0-android34.0
- CommunityToolkit.Mvvm (>= 8.2.2)
- Microsoft.Maui.Controls (>= 8.0.71)
- Microsoft.Maui.Controls.Compatibility (>= 8.0.71)
-
net8.0-ios17.5
- CommunityToolkit.Mvvm (>= 8.2.2)
- Microsoft.Maui.Controls (>= 8.0.71)
- Microsoft.Maui.Controls.Compatibility (>= 8.0.71)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 112 | 8/9/2024 |