Customizing Controls with Handlers in .NET MAUI

Ғылым және технология

NOTE: The code shown in this video is not working anymore. See updated video here: • .NET MAUI: Customize C...
UI controls in .NET MAUI are rendered via handlers, lightweight classes that map properties and features to bite-sized implementations. In this video we will learn how to override the default .NET MAUI handler behavior to tweak the native controls to our liking. Spoiler alert: much easier than Xamarin.Forms Custom Renderers!
💝 Join this channel to get access to perks:
kzread.info/dron/ral.html...
🛑 Don't forget to subscribe to my channel for more amazing content: kzread.info...
🐦 Follow me on Twitter: / jfversluis
🤝 Join the Discord server: / discord
🔗 Links
Sample App Repo: github.com/jfversluis/MAUICus...
Javier .NET MAUI Conversion Samples Repo: github.com/jsuarezruiz/xamari...
.NET MAUI Docs: docs.microsoft.com/dotnet/maui
.NET MAUI Repo: github.com/dotnet/maui
⏱ Timestamps
00:00 - Intro
00:12 - Inspect End Result
00:31 - Implement Custom Handler for All Views
06:09 - Custom Handlers for Multiple Platforms
07:23 - Running the Sample App
07:55 - Customize Specific Control: Button
09:51 - Customize Controls Without if compiler directives
11:53 - Why (Not) Use This Method
12:25 - Customize Controls with Partial Classes
17:53 - Outro
🎥 Video edited with Camtasia (ref): techsmith.z6rjha.net/AJoeD
🙋‍♂️ Also find my...
Twitter: / jfversluis
Blog: blog.verslu.is
Twitch: / jfversluis
All the rest: jfversluis.dev
#dotnetmaui #Handlers #Customize #dotnet #dotnet6 #XamarinForms #CustomRenderer #Renderers #CustomHandler

Пікірлер: 93

  • @jfversluis
    @jfversluis2 жыл бұрын

    !!! Please note that the code in this video does not work any more !!! Please see this updated video: kzread.info/dash/bejne/nWqOzZWBn5u_fto.html

  • @michaelbiono5213

    @michaelbiono5213

    Жыл бұрын

    Thanks for all the video updates to your Tutorials and Examples as MAUI Progresses

  • @shahanahmed9444
    @shahanahmed94442 жыл бұрын

    You’re a life saver. Whenever I think I need something, I can always count on learning it quick knowing you probably have a tutorial for it!

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    Thank you Shahan! 🥰

  • @latsbrah7589
    @latsbrah75893 жыл бұрын

    Awesome video, thank you! I hope we'll learn more about Shells in Maui.

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Good one! I should do more with Shell and .NET MAUI is a great point in time to do so, I will look into it!

  • @Tamer_Ali
    @Tamer_Ali3 жыл бұрын

    Thanks Gerald for answering my question 👍. You're the man.

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    No problem 👍 Thanks!

  • @anandshindey
    @anandshindey2 жыл бұрын

    I like Method 3. Awesome video . Keep them rolling. Thanks.

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    Me too! Looking forward to someone coming up with an even better solution though :D

  • @ermanomartins
    @ermanomartins3 жыл бұрын

    Great video and of course i get more videos about custom handlers ! Thank you !

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    More will come, thank you!

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    And thanks for becoming a member! Super appreciate it!

  • @nickyboomtube
    @nickyboomtube3 жыл бұрын

    Thanks, looking forward for more

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Stay tuned!

  • @SurinderSingh-ue9ft
    @SurinderSingh-ue9ft2 жыл бұрын

    Hi Gerald, Its an much needed video from you with clear presentation of handlers in MAUI, please go for custom controls video as well, Thanks

  • @metacapitalism5113
    @metacapitalism5113 Жыл бұрын

    Wonderful. Very useful.

  • @jfversluis

    @jfversluis

    Жыл бұрын

    Thanks!

  • @Thaizer
    @Thaizer3 жыл бұрын

    Very nice video. I like to see something about Custom Controls

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Thanks! It's coming! :)

  • @antonnasonov5451
    @antonnasonov54512 жыл бұрын

    Hi, Gerald! I've just found your videos and they are amazing! Could you please make a video about how to transform classic Xamarin.Forms custom render to .Net MAUI handler? If I have a bunch of custom renderers in my app, how should I remake them to handlers? Thanks in advance!

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    Thanks Anton! Appreciate it! That will definitely come :)

  • @Looking_Above
    @Looking_Above3 жыл бұрын

    Custom Controls for MAUI Please !!! :)

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Definitely coming!

  • @sps014

    @sps014

    3 жыл бұрын

    Yes

  • @MuhammadNadeem-wj6xd
    @MuhammadNadeem-wj6xd3 жыл бұрын

    Wow.... @Gerald is Back 🥳

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Wait, was I gone?! :o

  • @BelgianDaSeeD
    @BelgianDaSeeD2 жыл бұрын

    Thank you for this great video. Do you plan to do one on the MVU pattern in MAUI ? And/Or the declarative way to write UI with C#forMarkup or Comet ? I am currently a .NET developer but more backend. In my free time I use Flutter to develop some mobile app for personal use and I really like their approach but as it seems that it exists kind of a same way to do it with .NET, I am considering the possibility to use MAUI for my next apps. Of course I can do it in MVVM but I find MVU more interesting for my little apps. Anyway, keep up the good work, you're doing it great !

  • @kalixthuska8846
    @kalixthuska88463 жыл бұрын

    Hello Gerald, do you know if MAUI will have direct support of SVG images ? I've been using fonts for that case in XF, which is not ideal for every use case.

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    It will support SVGs out of the box!

  • @jean-baptistedioli1692
    @jean-baptistedioli16922 ай бұрын

    Thanks for the awesome video! I'm also interested in creating our own control, for example to create a new button style from scratch. :)

  • @abdulkabir_02
    @abdulkabir_025 ай бұрын

    Awesome video as always, can you make another video related to custom Button in tabbedpage ?

  • @akshayjain3197
    @akshayjain31973 жыл бұрын

    Its a great video. Just one question as it seems if we define the handler it will override the view property as whole what if we need different customize at different pages?

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    Thanks! You can write your own logic to handle the property. So either fix it with logic or create inheritances of the different controls and customize those separately :)

  • @hosseinaftabi7049
    @hosseinaftabi70493 жыл бұрын

    Great. It was so cool, I try to learn Xamarin one month ago, as you describe about MAUI its better to start learning MAUI not xamarin form in old way? and, Is that a good way to start new App with MAUI or i must wait for release final version?

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    It depends... If you want to start learning I would recommend Xamarin.Forms today. 90% what you learn about Forms will be applicable to .NET MAUI as well and it's a bit more stable at the time being. For a new app that you want to release to production... If you really want to start today; again Forms is the better option. If you can wait a. couple of months, definitely .NET MAUI. But there will be a transition possible from Forms to .NET MAUI so if you do start today in Forms, the transition should be relatively easy :) Also this video might help: kzread.info/dash/bejne/rKqEstxvdKSomZs.html

  • @ankits9791
    @ankits97915 ай бұрын

    Hi, I want to creat custom datagridListview handler to handle scrollchange event. Do you have any idea how to do that? Please help

  • @Tamer_Ali
    @Tamer_Ali3 жыл бұрын

    Gerald, Could you talk about release Xamarin Forms/MAUI apps automatically to App/Play Store using Azure DevOps?

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    I'll add it to the list!

  • @metacapitalism5113
    @metacapitalism5113 Жыл бұрын

    I quickly tried all three methods in a new project except I used the Entry control and removed the underline. All three methods worked fine. The sample code is under robreno forward slash CustomControlHandlerDemo. I found the 3rd method very nice, but am left with a question. It works, but is this not the recommended way any longer or are there issues to be concerned about? Thanks for this video, Gerald.

  • @billymartin6497
    @billymartin6497 Жыл бұрын

    Another great video. How could I use this to change the status bar background and text color ifor windows?

  • @jfversluis

    @jfversluis

    Жыл бұрын

    You mean the title bar? The top one with the close and minimize buttons?

  • @billymartin6497

    @billymartin6497

    Жыл бұрын

    @@jfversluis Yes. Toolkit behaviors only seems to work for android and iOS Title Bars.

  • @billymartin6497

    @billymartin6497

    Жыл бұрын

    Have you been able to figure it out yet?

  • @afgone123456
    @afgone123456 Жыл бұрын

    How do you do it for CollectionView? before, in xamarin I used to extend CollectionViewRenderer in Android and IOS projects.

  • @afgone123456

    @afgone123456

    Жыл бұрын

    Found it Microsoft.Maui.Controls.Handlers.Items.CollectionViewHandler

  • @AlvaroRivoir
    @AlvaroRivoir2 жыл бұрын

    Having a video explaining how to create custom controls would be great

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    The actual custom control is a bit hard because that is whatever you want to implement. I do have this: kzread.info/dash/bejne/lZah0cN9XbOqpKQ.html which should mostly be the same for .NET MAUI :)

  • @stefanhodges-kluck5580
    @stefanhodges-kluck55802 жыл бұрын

    Thanks for these videos! I am trying to implement this, and as of Version 17.0.0 Preview 7.0 of VS 2022, getting a message that "ButtonMapper does not exist on property ButtonHandler." "ElementHandler" property does exist, but that gives error, "Cannot apply indexing with [] to an expression of type 'IPropertyMapper'."

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    Seems there has been a change in that area already... I should make an updated video I guess 😅

  • @georgeoutters5657

    @georgeoutters5657

    2 жыл бұрын

    @@jfversluis Please make one. I can't seem to find anywhere how to use the "updated" version of this, even the official docs are wrong :/

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    Remember it’s all preview. I understand it can be frustrating but things change :)

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    See here for more info: twitter.com/jfversluis/status/1463886879703633930?s=21 I’ll post an updated video soon :)

  • @sanjeevareddneelam3889
    @sanjeevareddneelam38892 жыл бұрын

    Can we use xaml/wpf controls in maui.or only specified controls in maui

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    Just .NET MAUI controls, which you can use from XAML

  • @Guru1413
    @Guru14133 жыл бұрын

    Thanks for the video, How to handle Xamarin.Forms Dependency service & Effects in MAUI

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Those will both come, thanks!

  • @checox1909
    @checox19093 жыл бұрын

    WOW WELCOME MAUI ♥

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Expect a lot more to come! :)

  • @zeeshanbadshah5371
    @zeeshanbadshah53713 жыл бұрын

    Thanks 👍

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    My pleasure!

  • @Tamer_Ali
    @Tamer_Ali3 жыл бұрын

    Gerald, I hope you talk about how to make the design responsive for mobile and tablet in Xamarin Forms.

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Maybe in the future, probably not soon :) need to see some more of .NET MAUI for that first

  • @deniszhukovsky2260
    @deniszhukovsky22603 жыл бұрын

    To be honest I didn't get why the button's background been updated? It seems Gerald has overwritten "MyCustomization" property. Why is this delegate been called. Do we have MyCustomization bindable property somewhere?

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    That's what I mentioned. If you're overriding it like this the property name doesn't matter, it will call it anyway :)

  • @user-kl5ss9en2t
    @user-kl5ss9en2t Жыл бұрын

    hello ,i want to add a keydown event for Entry,and do some work Commandexecute,also remove the underline,could you give a video,i have see this video 3 method about handler,its prettey good.anther,Render is also could be used in Maui,are you intersting do some video Maui Render?thansk

  • @ralphgutierrez1838
    @ralphgutierrez18382 жыл бұрын

    This implementation won't work when I download the latest update.

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    WHAT! This is already obsolete?! :D What doesn't work exactly?

  • @robertojrcantos1711
    @robertojrcantos17113 жыл бұрын

    Hi Gerald. I tried to run .net Maui in UWP but it failed to execute.

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Without any details it's pretty hard to say something useful about it :)

  • @robertojrcantos1711

    @robertojrcantos1711

    3 жыл бұрын

    @@jfversluis can you please show us a blog of the .net Maui running in UWP? We duly appreciated if you let us see the sample. Thank you

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    @@robertojrcantos1711 I don’t know what to tell you. For me it just works :)

  • @robertojrcantos1711

    @robertojrcantos1711

    3 жыл бұрын

    @@jfversluis would please show us some example of .net Maui running UWP. To see is to believe.

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    I don’t think i have to prove anything and besides; why would I lie? Like I said; if you share some more details about what you’re seeing then I can maybe offer some assistance. I don’t think it’s very helpful that I show you how it’s running on my machine without any issues.

  • @UzairAli001
    @UzairAli0012 жыл бұрын

    Indeed Handlers are far better than Renderers, time to upgrade all of my renderers to handlers :)

  • @jfversluis

    @jfversluis

    2 жыл бұрын

    Do it!

  • @kwokyung376
    @kwokyung3762 жыл бұрын

    how to disable softkeyboard, drawing line using skiasharp canvas, getcursor position of Entry, create pdf using pdfSharp using Maui

  • @AngeloBestetti
    @AngeloBestetti3 жыл бұрын

    Very nice to globally set few things

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    It sure is! Much easier than a custom renderer :)

  • @mattkenefick
    @mattkenefick3 жыл бұрын

    He's using Android.Graphics.Color.Red around 8:02, but I think the more appropriate way to define colors would be to use the Maui package so it can be used universally; e.g. Microsoft.Maui.Graphics.Colors.Red.ToNative();

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Absolutely! Just sample code :)

  • @mattkenefick

    @mattkenefick

    3 жыл бұрын

    @@jfversluis Just letting the other viewers know as well :)

  • @loladeking
    @loladeking3 жыл бұрын

    Custom controls please

  • @jfversluis

    @jfversluis

    3 жыл бұрын

    Will work on it!

Келесі