Mtf.Maui.Controls
1.0.17
See the version list below for details.
dotnet add package Mtf.Maui.Controls --version 1.0.17
NuGet\Install-Package Mtf.Maui.Controls -Version 1.0.17
<PackageReference Include="Mtf.Maui.Controls" Version="1.0.17" />
paket add Mtf.Maui.Controls --version 1.0.17
#r "nuget: Mtf.Maui.Controls, 1.0.17"
// Install Mtf.Maui.Controls as a Cake Addin #addin nuget:?package=Mtf.Maui.Controls&version=1.0.17 // Install Mtf.Maui.Controls as a Cake Tool #tool nuget:?package=Mtf.Maui.Controls&version=1.0.17
Mtf.Maui.Controls Documentation
Overview
The Mtf.Maui.Controls
library provides a set of reusable, customizable ContentView
components for .NET MAUI applications. These components enhance user interface capabilities with features like labeled controls, hyperlinks, and numeric input.
Components
1. CheckBoxWithLabel
A ContentView
combining a CheckBox
with a customizable label.
Properties
- Label (
string
): The text displayed alongside the checkbox. - IsChecked (
bool
): The checked state of the checkbox. Supports two-way binding.
Commands
- ToggleCommand: Toggles the
IsChecked
state programmatically.
Example Usage
<controls:CheckBoxWithLabel
Label="Accept Terms and Conditions"
IsChecked="{Binding IsAccepted}" />
2. EntryWithLabel
A labeled Entry
field with extensive customization options.
Properties
- Label (
string
): The label displayed above or alongside the entry. - Placeholder (
string
): Placeholder text for the entry. Defaults toLabel
if not set. - Text (
string
): The entry�s text. Supports two-way binding. - Keyboard (
Keyboard
): The type of keyboard (e.g.,Keyboard.Numeric
). - IsPassword (
bool
): Indicates if the entry should mask text (e.g., for passwords). - IsReadOnly (
bool
): Disables text input whentrue
. - EntryTextColor (
Color
): Color of the entry text. - EntryMinimumWidthRequest (
int
): Minimum width of the entry. - EntryMinimumHeightRequest (
int
): Minimum height of the entry.
Events
- TextChanged: Triggered when the
Text
value changes.
Commands
- CopyToClipboardCommand: Copies the entry�s text to the clipboard.
Example Usage
<controls:EntryWithLabel
Label="Username"
Placeholder="Enter your username"
Text="{Binding Username}"
IsPassword="False" />
3. Hyperlink
A clickable hyperlink styled with visual feedback.
Properties
- Url (
string
): The URL to navigate to. - LinkLabel (
string
): The text displayed for the hyperlink.
Behavior
- Changes color on hover.
- Opens the URL in the system�s default browser.
Example Usage
<controls:Hyperlink
Url="https://example.com"
LinkLabel="Visit Example" />
4. MenuItemView
A customizable menu item with navigation support.
Properties
- ImageSource (
List<string>
): Image sources for the menu icon. - LabelText (
string
): Text displayed on the menu item. - PageType (
Type
): The page to navigate to when clicked. - Parameter (
object
): Parameter to pass during navigation. - AfterExecution (
ICommand
): Command to execute after navigation.
Commands
- NavigateCommand: Navigates to the specified page.
Example Usage
<controls:MenuItemView
LabelText="Settings"
PageType="{x:Type pages:SettingsPage}" />
You can set up the MenuItemView
to download images from an online source.
ImageSettings.UseOfflineImages = false;
ImageSettings.ImagesUrl = "https://cdn.example.com/images/";
ImageSettings.NumberOfDaysToCacheImages = 30; // Cache for 30 days
5. NumericUpDownWithLabel
A numeric input control with increment and decrement buttons.
Properties
- Label (
string
): Label displayed next to the control. - Value (
double
): Current value. Supports two-way binding. - Minimum (
double
): Minimum allowed value. - Maximum (
double
): Maximum allowed value. - Increment (
double
): Step size for value changes.
Events
- ValueChanged: Triggered when
Value
changes.
Behavior
- Pressing and holding increment or decrement buttons changes the value repeatedly.
Example Usage
<controls:NumericUpDownWithLabel
Label="Quantity"
Value="{Binding Quantity}"
Minimum="1"
Maximum="100"
Increment="1" />
Dependencies
- CommunityToolkit.Mvvm: Used for commands and messaging.
- System.Maui: Base dependency for MAUI applications.
Installation
Add the Mtf.Maui.Controls
library to your MAUI project via NuGet:
dotnet add package Mtf.Maui.Controls
License
This library is provided under the MIT License. Feel free to use and modify it in your applications.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-android34.0 is compatible. net8.0-ios18.0 is compatible. net8.0-maccatalyst18.0 is compatible. net8.0-windows10.0.19041 is compatible. |
-
net8.0-android34.0
- CommunityToolkit.Mvvm (>= 8.3.2)
- Microsoft.Maui.Controls (>= 8.0.100)
- Microsoft.Maui.Controls.Compatibility (>= 8.0.100)
-
net8.0-ios18.0
- CommunityToolkit.Mvvm (>= 8.3.2)
- Microsoft.Maui.Controls (>= 8.0.100)
- Microsoft.Maui.Controls.Compatibility (>= 8.0.100)
-
net8.0-maccatalyst18.0
- CommunityToolkit.Mvvm (>= 8.3.2)
- Microsoft.Maui.Controls (>= 8.0.100)
- Microsoft.Maui.Controls.Compatibility (>= 8.0.100)
-
net8.0-windows10.0.19041
- CommunityToolkit.Mvvm (>= 8.3.2)
- Microsoft.Maui.Controls (>= 8.0.100)
- Microsoft.Maui.Controls.Compatibility (>= 8.0.100)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.