MVVM Source Generators: Never Write MVVM Boilerplate Code Again!

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024

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

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

    There have been several updates to the library and name changes for the properties, so check out github.com/CommunityToolkit/dotnet/releases/tag/v8.0.0 for changes

    • @mikp1280
      @mikp1280 2 ปีที่แล้ว

      This comment saved my day :) Thanks James!

    • @meilleur102
      @meilleur102 2 ปีที่แล้ว

      Hi! Idk if you can help me on one thing. When I create a [ObservableProperty] of anything (string, ObservableCollection etc) the binding work perfectly.
      When I create a [ObservableProperty ] of a Model, i can't get the ui to update...I really don't get it.
      When I debug my Model.Properties get updated, but the ui dont. I try UpdateSourceTrigger=PropertyChanged, OneWay, TwoWay etc on the view. Nothing works.
      Thanks

    • @paulegan3783
      @paulegan3783 2 ปีที่แล้ว

      Cheers!

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

    Wow, finally something that fixes my biggest gripe with xaml MVVM development. Thx James!

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

    Makes the code so much cleaner, and easier to understand for others.

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

    This is so awesome! One of the hurdles of understanding and effectively using MVVM was getting your head around all the boilerplate plumbing code and understanding why it's needed. I always thought to myself "why can I just specify properties and commands and let the compiler do all the ceremony?" Yay! It finally happened!

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

    Amazing. This just made WPF applications 100 times easier. Thanks for the great video.

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

    This is beyond awesome! Super easy to implement. Makes your code soooo lean and easy to read. I love how you can use the code generation where you want to and still go the long route if you need to do stuff in your Get or Set. Excellent code! And a great video showing how to use it!

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

    Shout out to James! You continue to help me up my game. This MVVM source generator is awesome and I look forward to more updates on recent developments.

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

    I was stuck with mvvm since 2010. Now, I finally love it.

  • @xamarinmaster1403
    @xamarinmaster1403 11 วันที่ผ่านมา

    Awesome! I just tried this against OpenSilver and it works GREAT!

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

    You said it: it's ridiculously awesome. I've been working with WINUI 3 and i can see some differences that could be tricky for a newbie like me, but in the road we learn. Thanks James.

  • @twitterer
    @twitterer 2 ปีที่แล้ว

    Love to see the excitement in your own expressions, tells you how great it is !

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

    Great, great, great. And as usual, brilliantly described. Nice work James & team.

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

    MIND BLOWN! I love this with a passion. This helps reduce stupid errors both in initial creation and going back and modifying. This is awesome. I've used code generators in the past and I love them, but this is next level. Thanks again James!

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

    Hey James. You can do this for many years using propertychanged.fody nuget package.
    What is even better it can do this without all those attributes. Especially combined values like Full name from your example. You can use them directly without specifying that it should be updated in other properties attribute.
    The thing about ICommand is quite neat in your presentation, this is currently not present in propertychanged.fody
    But also it's quite small price to pay in comparison with all the boilerplate code for properties.
    On a side note. Keep up the good work. I was using many packages of yours for few years already. Thank you for every single one of them. Cheers

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

      I should have talked a bit about fody a bit in there. It is more assembly weaving to manipulate IL from my understanding. Where this is source generators where they are generated instantly without compilation. Correct me if I am wrong.

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

      @@JamesMontemagno You're right. Despite fody adding zero boilerplate, you do not have access to the generated code, because its generated at compile time. With source generators, you can see in real time all the code that is generated which is awesome in my opinion and gives us the opportunity to learn new things by exploring the generated code.

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

      @@JamesMontemagno I think the source generator might not be mature enough at this time. It sometimes bring in strange issues and I should reload the project for fixing it. Hope MSFT can make this tool much better.

    • @worknaturebalance
      @worknaturebalance 2 ปีที่แล้ว

      @@JamesMontemagno as Luiz said, you are absolutely right.
      Source generators have other benefits, but also propertychanged.fody gives you the same outcome with cleaner code (no attributes needed). Also I don't remember if I ever needed to inspect the code that got generated. In most cases it's quite simple.
      Would it be possible to use source generators without those attributes?

    • @morgenrot2640
      @morgenrot2640 2 ปีที่แล้ว

      @@williamliu8985 Unfortunately, I had to find that out too.

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

    Wow simply wow! The MCT.MVVM was already very helpful but this is incredible!

  • @kwesiboateng2646
    @kwesiboateng2646 2 ปีที่แล้ว

    My mind was blown james, when you decorated the private fields with ObservableProperty

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

    Yes, this would be my 1st personal choice among others mmvm library out there !! Thanks a bunch

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

    Wow, at last all that tons of lines went away... Keep those in just (a little few) attributes (not towers) thogh
    Maybe with a comma we'll avoid attributes towers. Great video!😎 James.

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

    Wow... Game changer. Kudos to all involved. Can't wait to start using it. Thanks for the video James 👍

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

    Thanks James! Amazing and easily broken down. Definitely applying this

  • @buddysnackit1758
    @buddysnackit1758 2 ปีที่แล้ว

    I actually made a post about "Why doesn't a system that generates the MVVM code for you!" in one of your older videos! Yes!

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

    Really great addition to the community toolkit! Thanks a lot for the tutorial.

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

    Hooo, I need to update my projects right now!!

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

    It's a great idea. Since I'm a WinForms guy I keep sliding back to it because it's so simple and I can write stuff fast and clean. I tried MVVM again on my latest Xamarin application (since WinForms was not an option) but still ended up using mostly code behind because I found all the MVVM stuff just too hard to keep track of and getting it to work cleanly with the UI was just too daunting. If these people can make it less complicated that would be great. I DID find the code it generated very scary looking though. If I get some bizarre error about eyepoke() not properly initialized or the my app just hanging or disappearing I would probably give up and go simple again.

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

    James, thank you for this video. I wrote so much code over the last years, that I can now delete. - Just a joke. I definitely check this out!

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

    The best MVVM content creator ever thanks james.

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

    Sweet! I use base classes to do some of that but it is not a lovely as using the attributes with the generators. The new code feels right and clean. Chunky boilerplate code has always felt dirty

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

    MVVM is now practical with this

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

    This is so good, that it makes me wonder why this wasn't there with the release of WPF.

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

    Yet again James is here to save the day for devs and students, thanks man.

  • @azizjel
    @azizjel 2 ปีที่แล้ว

    Listening to James makes me think of those old grow hair potion salesmen:
    " Well James, you wrote the ISync command, now What if you want to sink the Submit button and make it sing the song?"
    James:"Well you just need to carry the CommunityDev boilerplate which comes with the Generator..".
    Thanks for the the very interesting presentation James though! I like it 🙃😉

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

    While I've gotten used to MVVM in WPF, at the end of the day I'm still not convinced it is actually nearly as good a pattern as the head-in-the-clounds programers make it out to be. The reality of my (and I think many others) is simply not at the scale where we really profit from it. Back when we switched to it, it was sold with the promises of having the option to easily outsource the view design (because of the decoupling), being unit testable and being oh-so-efficient. After working with it for years, I have to say that I still end up writing most if not all of my view code myself. I have barely written any unit tests, because the stuff that actually fails is way to much effort to unit test and the simple stuff I have clicked through quicker than I've set up the test. And lastly I don't think having to do 3 things to handle a button event or drowning in property boilerplate code has made the code any more readable or quicker to produce. The tiny bit of intellisense support you get from it hardly makes it worth it imho. I know there are plenty of nugets and extension to help with this and we've used a couple of them mostly successfully over the years, but it never really felt like at the base the effort was worth it
    That being said, seeing this auto code generation I feel like we've finally reached a the point where the extra effort has been reduced to a level that no longer negates all the smaller benefits (I will probably still not write alot of unit tests or have some of those mythical html programmers swoop in and design beautiful GUIs for me :P). I just wish I could actually use it in all the older projets we still have to maintain, but sadly they are still mostly on .Net4.7. Well at least going forward it will become alot nicer.

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

    Top notch! Nice work.

  • @emmanueladebiyi2109
    @emmanueladebiyi2109 2 ปีที่แล้ว

    Truly an awesome library

  • @jimsimson7266
    @jimsimson7266 2 ปีที่แล้ว

    My mind IS blown James! Thank you!

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

    Game changer! Can't wait to get stuck in!

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

    Great tutorial, Thanks James.

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

    Thank you James for really nice video..
    One suggestion, could you please create video on DeepLinking where application can launch from url like Amazon...

  • @PticostaricaGS
    @PticostaricaGS 2 ปีที่แล้ว

    Excellent video, and great topic, there is still a lack of video-content on Source Generators

  • @astrowalker2629
    @astrowalker2629 2 ปีที่แล้ว

    Awesome, thank you very much. Now I am on the hunt for some good tutorials how to create such generators by myself 🙂.

  • @hrishikeshgarud7177
    @hrishikeshgarud7177 2 ปีที่แล้ว

    Very useful. I was doing everything code behind. Now i will try this.

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

    Amazing stuff, thanks You very much! I'm writing a simple app for my team and i just can't wrap my head around how inefficient to write is WPF.

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

    This is awesome! Very clever implementation.

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

    Many thanks to you James. This is really helpful and blowing my mind too 🤯🤯🤩.

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

    This is really great. Thanks for posting.

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

    I am with you. I created a source generator for MVVM 7 years ago, and since then I stopped writing a lot of a code. Everything is done by the source generator. Continue to propagate the idea.

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

      How many juniour developers could understand and extend on your code without wondering about black magic and stuff? D: I am very very cautious every time I see some work being done in background by some sort of extensions or dynamic code generation or self invented conventions nobody else in the world knows about. One thing is to rely on ms own attributes and conventions with tons of documentation and tests and usage and another is thinking that I am able to create, support and fix this on my own and that when I quit the job the next guy will know what the hell is happening in the code

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

      @@ostelaymetaule It is a very good concern and actually I had a fear that simply developers will run away. But to my surprise, a feedback was completely opposite. They gladly started using it. Why? If system is designed well, it is so natural and intuitive, developers on any level, especially juniors, just use it.

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

      @@kamertonaudiophileplayer847 I am glad to hear you managed to make it work, I have seen couple examples earlier in my career as well, but also encountered some over engineered magic bazoongas nobody knows what it does and the original dev is long gone ;)

    • @kamertonaudiophileplayer847
      @kamertonaudiophileplayer847 2 ปีที่แล้ว

      @@ostelaymetaule It is normal, we lost several good developers exactly for the reason. Some system for some reason wasn't designed by us well. The result was really disappointing, we started loosing people because they simply can't use the system. Solution? Do not be afraid of to redesign the system instead of trying to fix it little by little.

  • @paulegan3783
    @paulegan3783 2 ปีที่แล้ว

    Thanks so much James, very nice

  • @zandyaverhoff9554
    @zandyaverhoff9554 2 ปีที่แล้ว

    wow, how many things are change. Thank jame

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

    Hi James,
    Great content and thank you for bringing this to my attention, seems to work perfectly in your demo.
    Small question: You had an example with the asynchronous command. Will the binding still work if I postfix the name of the method to 'SubmitAsync'? Or does the generated binding only work, because the name is 'Submit' for the method and 'SubmitCommand' in the Xaml?

  • @kosteash
    @kosteash 2 ปีที่แล้ว

    wow James, you are amazing. You showed my so many cool nugets, that make my life easier. Thank you very much !

  • @Proto61
    @Proto61 2 ปีที่แล้ว

    Thank you for the awesome video, could you make a video how to use Messengers with the toolkit? And a video for navigation would be also very nice. Thank you!

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

    Great video, as usual, James. Couple quick questions: How do we pass command parameters? Does it function inside of VS 2019? Sometimes we have to drop back to use the MultiLingual extension, since it's not in VS 2022.

    • @JamesMontemagno
      @JamesMontemagno  2 ปีที่แล้ว

      I believe they should, but I only have 2022 on my machines now

    • @Sergio0694
      @Sergio0694 2 ปีที่แล้ว

      You can pass command parameter through whatever system the UI framework you're using has, that's separate from the command implementations the MVVM Toolkit has (for instance, on WPF/UWP/WinUI you'd do CommandParameter="{Binding ...}", or {x:Bind ...}, etc.). As for VS2019, no the generators will not work there. For the 8.0.0 release of the MVVM Toolkit I've rewritten all of them to be incremental generators, and that feature needs Roslyn 4.x to work, which isn't available on VS2019. You'll need VS2022 for that (or another modern IDE of your choice, eg. Rider). Hope this helps!

    • @JamesMontemagno
      @JamesMontemagno  2 ปีที่แล้ว

      Checkout github.com/CommunityToolkit/dotnet/issues/158 for a working sample, You will need to put things in a .NET Standard library for it to fully work.

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

    Thanks for the great content. Can you please also make a video on MVVM Messaging?

  • @RaabStephan
    @RaabStephan 2 ปีที่แล้ว

    This is honestly pretty amazing!

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

    An amazing tool I am using it for about a year -_-

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

    Such a great tool :) thx for sharing!!!!

  • @billashton6511
    @billashton6511 2 ปีที่แล้ว

    Looks like the future to me James..!

  • @anandshindey
    @anandshindey 2 ปีที่แล้ว

    This is awesome. Thanks James.

  • @suchtendolp644
    @suchtendolp644 2 ปีที่แล้ว

    You changed my life, bro.

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

    Great tutorial !!!

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

    Amazing that is what I wanted

  • @kashifenet1983
    @kashifenet1983 2 ปีที่แล้ว

    Cool that is too much life will be easy after using this Thank you JM

  • @Albahadly
    @Albahadly 2 ปีที่แล้ว

    Thanks James, you really treasure

  • @L-E-son
    @L-E-son 2 ปีที่แล้ว

    VERY cool! Thanks for sharing!

  • @nixnemo
    @nixnemo 2 ปีที่แล้ว

    Looks/sounds amazing. Many thanks for the efforts. If [ObservableProperty] attribute would work without compilation error, telling MyViewModel already exists, I would really appreciate. Many thanks in advance. Again, really appreciate what you done.

  • @anderson.damasio
    @anderson.damasio 2 ปีที่แล้ว

    very good this! James

  • @user-gq8of6kd4r
    @user-gq8of6kd4r 2 ปีที่แล้ว +1

    OMG this cool!

  • @JoseSilva-gt6zj
    @JoseSilva-gt6zj 2 ปีที่แล้ว +2

    Awesome explanation, James! Thank you! Let me ask about obfuscation. Do you know if it works after obfuscating the code? I mean for a WPF app. Thanks!

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

      Yes it does from my understanding, it is the same as if you wrote the code ;)

  • @mashrulhaque1168
    @mashrulhaque1168 2 ปีที่แล้ว

    Thank you so much James

  • @broadshare
    @broadshare 2 ปีที่แล้ว

    Good stuff, Maui has really delayed. We need to use all these stuff on production

  • @techsolve9397
    @techsolve9397 2 ปีที่แล้ว

    got a new teacher even i speak spanish .

  • @cristisandu678
    @cristisandu678 2 ปีที่แล้ว

    Wow, it is very useful. Thx a lot for the tips 👏 Can you make a video for API generator ?

  • @miguelmunozluman4732
    @miguelmunozluman4732 2 ปีที่แล้ว

    Sorcery! jajaja what amazing change!

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

    Hi James, I love your tutorials. I've been diving a bit deeper into the MMVM Toolkit as I steadily replace my old MVVMLight code. One area not covered in your video that I'd like some more insight into is the ICommand "RaiseCanExecuteChanged". I'm seeing things like [NotifyCanExecuteChangedFor] in the new Toolkit that looks promising. Do you have a video that covers this or can you point me somewhere that might? Thanks so much.

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

    Awesome 😊

  • @ArabGirlLifestyle
    @ArabGirlLifestyle 2 ปีที่แล้ว

    Doesn't work with VS for Mac in Xamarin for iOS or Android :(

    • @JamesMontemagno
      @JamesMontemagno  2 ปีที่แล้ว

      Source generators will need the latest version of .NET installed on the machine. I would test out VS 2022 preview and it should work there.

  • @mubarekabdi
    @mubarekabdi 2 ปีที่แล้ว

    Super useful ! Thanks 👍

  • @ferdinandcastilho
    @ferdinandcastilho 2 ปีที่แล้ว

    Great!! Thanks for sharing

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

    I keep getting "the namespace for AlsoNotifyChangeForAttribute could not be found" Error when I try using AlsoNotifyChangeForAttribute in my view model property

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

      The final version introduces some new names github.com/CommunityToolkit/dotnet/releases/tag/v8.0.0

    • @maso4u
      @maso4u 2 ปีที่แล้ว

      @@JamesMontemagno Oh! thank you, I thought I had broken something somewhere
      Are you aware if there have been any fixes on the .Net SDK bug that duplicates source generators on-build?

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

    Excellent!

  • @abba5102
    @abba5102 2 ปีที่แล้ว

    Waw that's awesome thank you sir.

  • @ali_jb94
    @ali_jb94 7 หลายเดือนก่อน

    Fantastic video,!

  • @rxtx3948
    @rxtx3948 2 ปีที่แล้ว

    Stunning beautiful

  • @michaldivismusic
    @michaldivismusic 2 ปีที่แล้ว

    I'll be able to remove about a 1/4 of all the code from my projects, awesome!

  • @StephBsimon
    @StephBsimon 2 ปีที่แล้ว

    looks super cool. Their documentation though... haven't seen any of the attribute decorations you're showing here. Their sample project is unbuildable... whole folders missing and package ref hell... quite discouraged

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

      They are still updating it because it is still in preview, but checkout their GitHub for samples

    • @StephBsimon
      @StephBsimon 2 ปีที่แล้ว

      yes thx James, I managed to run their sample mvvm at last.. good stuff. Thanks for the great vid.

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

    ⚠Just in case, [ICommand] was renamed to [RelayCommand].

  • @ssg3219
    @ssg3219 2 ปีที่แล้ว

    AlsoNotifyCanExecuteFor() and the AllowConcurrentExecutions flag are currently missing from the Community Toolkit. Will they be coming back? If not, how should that functionality be implemented?

  • @b2iceme812
    @b2iceme812 2 ปีที่แล้ว

    this the best code in behind... the only not enough is the UI is not real customizable like entry...

  • @prashantsingh1621
    @prashantsingh1621 2 ปีที่แล้ว

    I didn't get the ICommand part, like how mapping is done when we have two commands.
    Okay will try this. But this is so easy and clean

    • @JamesMontemagno
      @JamesMontemagno  2 ปีที่แล้ว

      If your method is called "GetMonkeys" it will generate "GetMonkeysCommand" for you automatically.

  • @felipeapj
    @felipeapj 2 ปีที่แล้ว

    I wish a can give more than just a thumbs up, thats awesome!!!

  • @RajK09
    @RajK09 2 ปีที่แล้ว

    It'll be very useful. What if we'd like to call a method when a property has changed?

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

    Is there a source generator or other clean way to add undo/redo functionality to the form in your example?

  • @WarBorg
    @WarBorg 2 ปีที่แล้ว

    hey James, awesome video as always, one question sits on my mind, how does this work with the xamarin community toolkit and the future MAUI community toolkit, as I see some overlapping bits, thx!

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

      So they are all on the same GitHub organization now and are aligned. The genera .NET one will focus on full compatibility with all .NET apps and then the individual one will be specific to the frameworks and they are working on minimizing any overlap

    • @WarBorg
      @WarBorg 2 ปีที่แล้ว

      @@JamesMontemagno awesome thx for the answer, I really like the code generated stuff but I would like to use the xamarin / Maui community toolkit as well and not have to worry about using the wrong namespace :D

  • @chandra_arifin
    @chandra_arifin 2 ปีที่แล้ว

    Awesome... Like it so much. 😍😍😍👍👍👍

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

    In using the MVVM pattern, how do you go about handling Navigation.PushModalAsync when it often expects a parameter of type Page? In particular, this seems to be a concern of mine when handling a page NOT defined as a shell page. For instance, a settings modal. It seems peculiar that you get caught in an issue where the .xaml.cs of a page gets set with the BindingContext = viewModel.

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

    Hi James, how can I implement an ObservableCollection using this method?

  • @jewersp
    @jewersp 2 ปีที่แล้ว

    Hi James. This is pretty awesome. The pattern with the if(SetProperty(...)) { ... } is not new to me, I've been using that already for a while now since MvvmLight allowed me to do the same thing, except for the code generation part of it. Does this mean that we can reuse our ViewModels and share them between Xamarin/MAUI and WPF applications? Does the new Community Toolkit also include ICommand derivatives and implementations for IAsyncCommand like the Xamarin Community Toolkit does? BTW, I absolutely love that we can update the canExecute flag of Commands using attributes now, it takes away a lot of messy code pain.

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

      It does, it included RelayCommand and AsyncRelayCommand or something like that, it is what it generates

    • @jewersp
      @jewersp 2 ปีที่แล้ว

      @@JamesMontemagno that's awesome. Thanks! 😊

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

    Excellent library, great video!
    Does this also work for Xamarin Forms and WPF?

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

      Yes it does!

    • @royeagle
      @royeagle 2 ปีที่แล้ว

      I tried it but I get “This generator is not generating files…”

    • @royeagle
      @royeagle 2 ปีที่แล้ว

      @@JamesMontemagno I can get the ObservableProperty to work after changing to C# 9 in Xamarin Forms. Can't get the ICommand to work, the method is never called. Ver 8.0 preview2.

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

      I figured it out. I named my method ClickMeCommand and it did not work. I changed it to ClickMe and now it works.

  • @MrMmajeed
    @MrMmajeed 2 ปีที่แล้ว

    Holy Molly!!!

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

    Can you create some advanced tutorial on this? Navigation bar with views, commands and stuff?