DEV Community

David Ortinau
David Ortinau

Posted on

Roundup of .NET MAUI Libraries - Week of June 13, 2022

What has shipped in the space of .NET MAUI this week?

.NET MAUI Service Release 1

This week .NET MAUI shipped it's first post-GA servicing with loads of bug fixes. Though it is versioned 6.0.400, the workload has manifests for the .NET SDK 6.0.300 "band" so you can install it with the stable .NET SDK as well as the 6.0.400-preview releases now shipping in Visual Studio previews.

Community Libraries

Looking chronologically through NuGet for those that stood out to me for adding or updating .NET MAUI support.

Constraint Layout

If you like to define your layouts via constraints, this library may be for you.

Compiled Bindings

x:Bind all the things! Looking at the examples on the GitHub page, I might start using this myself.

<Label
  HorizontalOptions="Center"
  FontSize="32"
  SemanticProperties.HeadingLevel="Level1"
  Text="{x:Bind Hello}" />
Enter fullscreen mode Exit fullscreen mode

Sentry

Sentry offers error tracking and performance monitoring for many frameworks, and is now adding support for .NET MAUI.

Fluxera Guards

this.Name = Guard.Against.NullOrWhiteSpace(name, nameof(name));
this.Credit = Guard.Against.Negative(credit, nameof(credit));
Enter fullscreen mode Exit fullscreen mode

Vapolia MauiGestures

This library offers a bunch of gestures with conveniences: Tap, DoubleTap, Pan, LongPress, TapPoint, DoubleTapPoint, PanPoint, LongPressPoint, SwipeLeft, SwipeRight, SwipeTop, SwipeBottom, Pinch

<StackLayout ui:Gesture.TapCommand="{Binding OpenCommand}" IsEnabled="True">
    <Label Text="1.Tap this text to open an url" />
</StackLayout>

<StackLayout ui:Gesture.DoubleTapPointCommand="{Binding OpenPointCommand}" IsEnabled="True">
    <Label Text="2.Double tap this text to open an url" />
</StackLayout>

<BoxView
    ui:Gesture.PanPointCommand="{Binding PanPointCommand}"
    HeightRequest="200" WidthRequest="300"
    InputTransparent="False"
    IsEnabled="True"
     />
Enter fullscreen mode Exit fullscreen mode

ESRI ArcGIS

Neo Controls

Neumorphic styled controls.

NeoControls

<NeoButton>
    <NeoButton.BackgroundGradient>
        <LinearGradient Angle="45">
            <NeoGradientStop Color="Red" Offset="0" />
            <NeoGradientStop Color="Yellow" Offset="1" />
        </LinearGradient>
    </NeoButton.BackgroundGradient>

    <StackLayout Orientation="Vertical">
        <Image Source="MyImage.png "/>
        <Label Text="My Button Label"/>
    </StackLayout>
</NeoButton>
Enter fullscreen mode Exit fullscreen mode

AppActions.Icons

This library adds default icons for common AppActions which are those shortcuts you can do from the app icon.

public static MauiApp CreateMauiApp()
{
    var builder = MauiApp.CreateBuilder();
    builder
        .UseMauiApp<App>()
        .ConfigureEssentials(essentials =>
        {
            essentials
                .UseAppActionIcons() // Add this line
                .AddAppAction("home_sc", "Home", icon: AppActionIcon.Home)
                .OnAppAction(App.HandleAppActions);
        });

    return builder.Build();
}
Enter fullscreen mode Exit fullscreen mode

FluentRest

This reminds me of https://flurl.dev and I'm not sure what this does better. I'm a fan of this style.

var result = await "https://api.mysite.com"
    .AppendPathSegment("person")
    .SetQueryParams(new { api_key = "xyz" })
    .WithOAuthBearerToken("my_oauth_token")
    .PostJsonAsync(new { first_name = firstName, last_name = lastName })
    .ReceiveJson<T>();
Enter fullscreen mode Exit fullscreen mode

Vapolia UserInteraction

A set of conveniences for handling coming interactions like Confirm, Alert, Menu, Toast, ActivityIndicator, etc..

Context Menu Container

A context menu is something .NET MAUI may include in the future, particularly for desktop. For now it's great to see that a library like this exists to fill the need!

<c:ContextMenuContainer x:Name="container1">
            <c:ContextMenuContainer.MenuItems>
                <c:ContextMenuItem Text="Action 1" Command="{Binding FirstCommand}" CommandParameter="Action 1 pressed!" />
                <c:ContextMenuItem Text="Action with icon" Command="{Binding FirstCommand}" CommandParameter="Action with icon pressed!" Icon="{Binding SettingsIconSource}"/>
            </c:ContextMenuContainer.MenuItems>
            <c:ContextMenuContainer.Content>
                <Frame BackgroundColor="ForestGreen" Padding="24" CornerRadius="0" >

                    <Label Text="{Binding Text}" HorizontalTextAlignment="Center" TextColor="White" FontSize="36" HorizontalOptions="FillAndExpand" VerticalOptions="Center" MinimumHeightRequest="30" MinimumWidthRequest="100"/>

                </Frame>
            </c:ContextMenuContainer.Content>
        </c:ContextMenuContainer>
Enter fullscreen mode Exit fullscreen mode

Plugin.LocalNotification

var notification = new NotificationRequest
{
    NotificationId = 100,
    Title = "Test",
    Description = "Test Description",
    ReturningData = "Dummy data", // Returning data when tapped on notification.
    Schedule = 
    {
        NotifyTime = DateTime.Now.AddSeconds(30) // Used for Scheduling local notification, if not specified notification will show immediately.
    }
};
await NotificationCenter.Current.Show(notification);
Enter fullscreen mode Exit fullscreen mode

BarCodeScanner

The name says it all.

ReactorUI

This is a cool ReactJS and Flutter inspired UI library for .NET MAUI.

private VisualNode RenderPhoneLayout()
        {
            return new ScrollView
            {
                new VerticalStackLayout
                {
                    new CurrentWidget(),

                    new BoxView()
                        .HeightRequest(1),

                    new Next24HrWidget(),

                    new Next7DWidget()
                }
                .Padding(0,50)
                .Spacing(25)
            };
        }
Enter fullscreen mode Exit fullscreen mode

Top comments (0)