Effective Alerts with Snackbar & Toast with .NET MAUI
ฝัง
- เผยแพร่เมื่อ 5 ส.ค. 2024
- Snackbar and Toast are two very common concepts across a variety of platforms. With the .NET MAUI Community Toolkit, it is now easier than ever to show Snackbar and Toast alerts in your .NET MAUI application. In this video I will show you how to show your first alerts to your users in minutes.
💝 Join this channel to get access to perks:
th-cam.com/channels/ral.html...
🛑 Don't forget to subscribe to my channel for more cool content: th-cam.com/users/GeraldVerslui...
🔗 Links
Sample code repository: github.com/jfversluis/MauiToo...
Blogpost by Vlad: vladislavantonyuk.azurewebsit...
Snackbar/Toast Docs: learn.microsoft.com/en-us/dot...
.NET MAUI Docs: docs.microsoft.com/dotnet/maui
⏱ Timestamps
0:00 - Snackbar & Toast for .NET MAUI
0:15 - What is Snackbar & Toast?
1:00 - What is the difference between Snackbar & Toast?
1:30 - Install .NET MAUI Community Toolkit
3:14 - Implement Showing a Toast Alert
7:13 - Toast/Snackbar on Windows
8:27 - Implement Snackbar Alert
12:38 - More Advanced Snackbar Features
14:37 - Learn More About .NET MAUI Community Toolkit
🎥 Video edited with Camtasia (ref): techsmith.z6rjha.net/AJoeD
🙋♂️ Also find my...
Blog: blog.verslu.is
Twitch: / jfversluis
All the rest: jfversluis.dev
#maui #snackbar #toast #alert #dotnet #dotnetmaui #communitytoolkit - วิทยาศาสตร์และเทคโนโลยี
Hold up! The .NET MAUI Community Toolkit has a lot more amazing things that will you much more productive in building your .NET MAUI apps. I have this curated playlist with Community Toolkit videos, right here, check it out! th-cam.com/video/nCNh9G-Q688/w-d-xo.html
Very helpful. Simple and clear explanations !
Glad you liked it
Nice!! That helped me a lot and my new app is with that toasts much more fancy than using default alerts.
Awesome, thanks for letting me know David!
Another great video! Thanks!
Thank you!
really really easy! thanks for teaching!
Glad it was helpful!
Great content as always !
Thank you!
Thank you for this great effort 👍👍👍
Thank you!
Thanks for all you tutorial...
Absolutely my pleasure, thank you for watching!
Clear explanation
Well done 👍
Thanks friend!
Great informativ Content
Thanks Gerald
Thank you!
Thank you for your effort about dotnet environment!
Much appreciated! Thanks!
Thanks Alot 🤗🤗
Thanks for the video
Thank you for watching!
Super!
Thank you very much!
Nice video!
Would you please make tutorial to replace the indicatorView's Dots for CarouselView's Images.
Like a Thumbnails
Just did this targetting Windows (I'm using Win 10) and noticed that when you click the "YES!" button, along with popping up the message window, it also creates a new instance of the app: if you do it again it will keep generating a new instance of the app. Thought that was pretty odd...
How can we use TouchEffects, Animations and Long press in .Net MAUI?
is it possible to make the "snackbar" bigger?
for me it appears behind the back button from android and I have no Idea how to fix that since there is no "fontSize" or "Size" setting
Thanks!
I can now replace the notification that shows up with a nice little popup at the bottom of your screen.
Awesome! Good luck!
@@jfversluis Thank you!
Great stuff, thanks! I wonder how would you go about on using this in an MVVM scenario?...
It’s a static class that you can use so you can simply call is from your ViewModels just as well
@@jfversluis thanks. Was thinking along those lines. 😊
You can do that, but you probably shouldn't as it's UI. UI code doesn't belong in a ViewModel, and it will make your ViewModel much harder to test.
Thanks for the video! Can you please tell me how I can set my own font in SnackBar?
You can set it through the VisualOptions
Gerald, How can i target the control in view from ViewMode for anchor?
Snackbar.Make("Some instructions", null, "X", TimeSpan, Options , Anchor_Control_Name_From_View?);
Thanks for the great explanation.
In iOS 13.3.1, the snackbar background color is not colored.
Thanks! Please open an issue for that on the repo
Hi, @@jfversluis
Thank you for your reply.
I'll try to report an issue.
I am just checking this. How to prevent it starts a new xaml form on windows when I click on the snackbar or the toast?
I think you just hopped on the Community Toolkit Discord, ask there or open an issue on the repo if you think we should change that!
Awesome 👍, Please use Dark Mode on Visual Studio on Demo's in the future video's, almost blinded by light mode lol 😂
Thanks for the feedback. Won’t happen though :)
@@jfversluis Why :(
Then I’ll get comments asking for light mode 🤷♂️ I prefer light mode myself, it provides better contrast for those who need it
Do you know if there is some difference between using webview with blazor and xaml? I mean performance, UX, delays, etc. Which do you recomend? Thanks
Performance should be very similar, delays... Shouldn't be happening unless you write blocking code, UX is dependant on what you implement, you can create great (or very bad) UX with both. Both can do the same thing but in a very different way. I can't really recommend because it's a bit of a personal choice. Do you like HTML/CSS more? Or do you have requirements to work with that? Go with Blazor! Are you more familiar with XAML and/or want that native look-and-feel? Go with XAML!
@@jfversluis Thanks for the answer. In this app I'll have to show a kind of overview of a calendar with information within each day. Do you know any library that help me reach that?
Can a library only run in blazor but not in xaml? or vice versa?
@@ezecel9 do you need to have lots of gestures? xaml have built in components, html you can use syncfusion but if you dont want third party libraries you need to do them yourself.
Some libraries work with xaml but not blazor and viceversa. When I used the BarcodeScanner it worked only with xaml so I made another page and then switch back to the Blazor WebView. You can mix them, it's not like you only have to use razor components or only xaml pages.
Hi Gerald, every time I press either snackbar / toast in windows, it creates a new instance of the app.. even if I specify no actions at all.
How do I prevent this?
Check if there is an issue for it on the Toolkit repo, if not, please open one so we can have a look. It might be that this is Windows behavior we can't really control though, but might be worth having a look.
thank you. would you please make tutorial for playing embedded mp3 files (without internet) in xamarin forms and .net maui. thank you agian.
You probably want to have a look at this one: th-cam.com/video/oIYnEuZ9oew/w-d-xo.html
@@jfversluis thank you very much.
using Anchor is crashing in ios, any help on this
Make sure it’s reported on the repository!
Hi
Can I add my icon to snackbar ?
Unfortunately not
Thans for the tutorial, do you know how to change de title of the toast on Windows?
I don’t think you can? Not through this at least. Is it possible in a Windows app normally?
@@jfversluis I think it is, but since the toat’s title is the project name, this isn’t a best choice because the name isn’t user friendly.
@@DanielAncines It's probably the app name which by default is the project name, but you can change that
@@jfversluis unfortunately we can’t, I’ve been trying and doesn’t work, whatever you change on project, the title still the same.
@@DanielAncines Change this value: github.com/jfversluis/MauiToolkitSnackbarToastSample/blob/main/MauiToolkitSnackbarToastSample/MauiToolkitSnackbarToastSample.csproj#L15
Uninstall the app from your Windows, rebuild the project and the name is changed.