.NET MAUI Community Toolkit adds TouchBehavior support

By Paul Krill

Microsoft has introduced version 8 of the .NET MAUI (Multi-platform App UI) Community Toolkit, featuring TouchBehavior, for interacting with visual elements in an application based on touch, mouse clicks, and hover events.

The update was introduced April 24. Instructions for getting started with the toolkit are available on GitHub.

With the new release, the TouchBehavior implementation enables customization of different visual properties on the VisualElement it is attached to, such as the background color, opacity, scale, and rotation. TouchBehavior also makes it possible to implement long-press touch gestures and enables invoking of code whenever a user presses any visual element in an app. TouchBehavior formerly was known as TouchEffect in the Xamarin Community Toolkit in the Xamarin.Forms app.

The upgraded toolkit also lets users color the Android navigation bar so an app will feel more immersive; the theme is integrated with whatever is seen on the screen. Additionally, users can control whether the navigation bar shows its light content or dark content, pertaining to icons in a light or dark color. This is intended to ensure that the navigation bar matches an app’s style.

The .NET MAUI Community Tookit serves as a community-created library with .NET MAUI extensions, advanced UI/UX controls, and behaviors intended to help developers. .NET MAUI Community Toolkit 8 also comes with some breaking changes:

For an upcoming edition of the toolkit, plans call for supporting CameraView, which now is being ported from Xamarin to .NET MAUI. This capability will be released as a separate package. Also for the future, improvements are being made to MediaElement to bring deeper integration with the operating system like playing media from the lock screen and showing relevant metadata.

© Info World