Getting Started
The Modus MAUI components package is hosted publicly through the nuget.org
Installation
- In your dotnet MAUI application, right click on the Dependencies -> Manage Nuget Packages and search and choose the Trimble.Modus.Components and click the Add Package
Here’s the direct link: Trimble.Modus.Components
- Add the following using statement in your MauiProgram:
using Trimble.Modus.Components.Hosting;
- Then register the handlers to use the Modus components
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseTrimbleModus()
// register other handlers
return builder.Build();
}
}
Now you can use the controls in your app.
- For Windows application, add the following in Platform/Windows/App.xaml file.
<maui:MauiWinUIApplication.Resources>
<Thickness x:Key="TextControlBorderThemeThickness">0</Thickness>
<Thickness x:Key="TextControlBorderThemeThicknessFocused">0</Thickness>
</maui:MauiWinUIApplication.Resources>
Usage
- Add the NuGet to the project as discussed in the above reference section.
- Add the namespace as shown in the following code sample:
xmlns:modus="http://modus.trimble.com/components"
- Use the controls inside the ContentPage. E.g.
<modus:TMButton Text="Click Me!"
LeftIconSource="email.png"
Clicked="TMButton_Clicked" />
For more details about controls, visit each control’s respective documentation under the components section.