The TouchEffect from Xamarin has been ported to .NET MAUI and is now known as the TouchBehavior! While the TouchBehavior can do many things, one of them is detect long press on any visual element in your .NET MAUI app.
In this video we will see how you can use TouchBehavior to detect long press in your app and invoke functionality as part of that.
💝 Join this channel to get access to perks:
https://www.youtube.com/channel/GeraldVersluis/join
Disclaimer: this channel is done on personal title, in my free time, and not officially affiliated with or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.
🛑 Don't forget to subscribe to my channel for more cool content: https://www.youtube.com/GeraldVersluis/?sub_confirmation=1
🐦 Follow me on Twitter: https://twitter.com/jfversluis
🤝 Join the Discord server: https://discord.gg/2cAyTGNHBD
🔗 Links
Sample app repository: https://github.com/jfversluis/MauiLongPressSample
.NET MAUI Community Toolkit: https://github.com/CommunityToolkit/Maui
⏱ Timestamps
00:00 - Detect Long Press in .NET MAUI
00:16 - What Is TouchBehavior?
01:05 - TouchBehavior LongPress
02:03 - Install .NET MAUI Community Toolkit
04:50 - Implement TouchBehavior Long Press
09:35 - Live Demo on Android
11:14 - Want to Learn More?
🎥 Video edited with DaVinci Resolve
🙋♂️ Also find my...
Blog: https://blog.verslu.is
All the rest: https://jfversluis.dev
#dotnetmaui #longpress #touchbehavior #toucheffect