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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 71

  • @jfversluis
    @jfversluis  ปีที่แล้ว +4

    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

  • @totototo4093
    @totototo4093 ปีที่แล้ว

    Very helpful. Simple and clear explanations !

  • @DavidStania
    @DavidStania ปีที่แล้ว +1

    Nice!! That helped me a lot and my new app is with that toasts much more fancy than using default alerts.

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Awesome, thanks for letting me know David!

  • @YaSiRaRaFaTdoTNet
    @YaSiRaRaFaTdoTNet ปีที่แล้ว +1

    Another great video! Thanks!

  • @josedonizeteoliveirajunior1744
    @josedonizeteoliveirajunior1744 ปีที่แล้ว +1

    really really easy! thanks for teaching!

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Glad it was helpful!

  • @SliemLichtenberg
    @SliemLichtenberg ปีที่แล้ว

    Great content as always !

  • @deaasaleh3613
    @deaasaleh3613 ปีที่แล้ว

    Thank you for this great effort 👍👍👍

  • @resler7ooo118
    @resler7ooo118 ปีที่แล้ว

    Thanks for all you tutorial...

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Absolutely my pleasure, thank you for watching!

  • @yousifarshak
    @yousifarshak ปีที่แล้ว

    Clear explanation
    Well done 👍

  • @DeepWorksStudios
    @DeepWorksStudios ปีที่แล้ว

    Great informativ Content
    Thanks Gerald

  • @AsiaSissyLoveBBC
    @AsiaSissyLoveBBC ปีที่แล้ว

    Thank you for your effort about dotnet environment!

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Much appreciated! Thanks!

  • @alialshreef2874
    @alialshreef2874 4 หลายเดือนก่อน

    Thanks Alot 🤗🤗

  • @ezecel9
    @ezecel9 ปีที่แล้ว

    Thanks for the video

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Thank you for watching!

  • @VicEstampida
    @VicEstampida ปีที่แล้ว

    Super!

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Thank you very much!

  • @aoruspurple5872
    @aoruspurple5872 ปีที่แล้ว

    Nice video!
    Would you please make tutorial to replace the indicatorView's Dots for CarouselView's Images.
    Like a Thumbnails

  • @RichardMilesMorris
    @RichardMilesMorris ปีที่แล้ว

    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...

  • @jamalfazeli9127
    @jamalfazeli9127 ปีที่แล้ว

    How can we use TouchEffects, Animations and Long press in .Net MAUI?

  • @Mielesplayz
    @Mielesplayz ปีที่แล้ว

    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

  • @Mielesplayz
    @Mielesplayz ปีที่แล้ว

    Thanks!
    I can now replace the notification that shows up with a nice little popup at the bottom of your screen.

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Awesome! Good luck!

    • @Mielesplayz
      @Mielesplayz ปีที่แล้ว

      @@jfversluis Thank you!

  • @stargazerNC
    @stargazerNC ปีที่แล้ว

    Great stuff, thanks! I wonder how would you go about on using this in an MVVM scenario?...

    • @jfversluis
      @jfversluis  ปีที่แล้ว +2

      It’s a static class that you can use so you can simply call is from your ViewModels just as well

    • @stargazerNC
      @stargazerNC ปีที่แล้ว +2

      @@jfversluis thanks. Was thinking along those lines. 😊

    • @Zamphie
      @Zamphie ปีที่แล้ว +1

      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.

  • @user-rp2rt6ws8m
    @user-rp2rt6ws8m ปีที่แล้ว

    Thanks for the video! Can you please tell me how I can set my own font in SnackBar?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      You can set it through the VisualOptions

  • @moatasemkremed5395
    @moatasemkremed5395 ปีที่แล้ว

    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?);

  • @cat0363-es3xs
    @cat0363-es3xs ปีที่แล้ว

    Thanks for the great explanation.
    In iOS 13.3.1, the snackbar background color is not colored.

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Thanks! Please open an issue for that on the repo

    • @cat0363-es3xs
      @cat0363-es3xs ปีที่แล้ว

      Hi, @@jfversluis
      Thank you for your reply.
      I'll try to report an issue.

  • @valentinoromelio5414
    @valentinoromelio5414 4 หลายเดือนก่อน

    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?

    • @jfversluis
      @jfversluis  4 หลายเดือนก่อน

      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!

  • @aathifmahir
    @aathifmahir ปีที่แล้ว

    Awesome 👍, Please use Dark Mode on Visual Studio on Demo's in the future video's, almost blinded by light mode lol 😂

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Thanks for the feedback. Won’t happen though :)

    • @christerad1669
      @christerad1669 ปีที่แล้ว

      @@jfversluis Why :(

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Then I’ll get comments asking for light mode 🤷‍♂️ I prefer light mode myself, it provides better contrast for those who need it

  • @ezecel9
    @ezecel9 ปีที่แล้ว

    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

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      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!

    • @ezecel9
      @ezecel9 ปีที่แล้ว

      @@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?

    • @ghevisartor6242
      @ghevisartor6242 ปีที่แล้ว

      @@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.

  • @adrianllamido759
    @adrianllamido759 ปีที่แล้ว

    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?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      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.

  • @hasansafi3341
    @hasansafi3341 ปีที่แล้ว

    thank you. would you please make tutorial for playing embedded mp3 files (without internet) in xamarin forms and .net maui. thank you agian.

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      You probably want to have a look at this one: th-cam.com/video/oIYnEuZ9oew/w-d-xo.html

    • @hasansafi3341
      @hasansafi3341 ปีที่แล้ว

      @@jfversluis thank you very much.

  • @vknigam1988
    @vknigam1988 2 หลายเดือนก่อน

    using Anchor is crashing in ios, any help on this

    • @jfversluis
      @jfversluis  2 หลายเดือนก่อน

      Make sure it’s reported on the repository!

  • @cissemy
    @cissemy ปีที่แล้ว

    Hi
    Can I add my icon to snackbar ?

  • @DanielAncines
    @DanielAncines ปีที่แล้ว

    Thans for the tutorial, do you know how to change de title of the toast on Windows?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      I don’t think you can? Not through this at least. Is it possible in a Windows app normally?

    • @DanielAncines
      @DanielAncines ปีที่แล้ว

      @@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.

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      @@DanielAncines It's probably the app name which by default is the project name, but you can change that

    • @DanielAncines
      @DanielAncines ปีที่แล้ว

      @@jfversluis unfortunately we can’t, I’ve been trying and doesn’t work, whatever you change on project, the title still the same.

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      @@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.