Paul Krill
Editor at Large

.NET MAUI Community Toolkit adds TouchBehavior support

news
Apr 25, 20242 mins

TouchBehavior provides the ability to interact with visual elements in .NET apps based on touch, mouse clicks, and hover events.

digital transformation /finger tap causes waves of interconnected digital ripples

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 TouchBehavior, the Community Tookit builders discovered that the binding context was not applied correctly. This applied to all other behaviors in the toolkit and a fix was applied, technically as a breaking change.
  • The implementation of the Snackbar timed alert on Windows was a complete rewrite. Some crashes have been fixed; the Windows app is no longer launching another instance of a Windows app when interacting with a Toast or Snackbar.

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.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author