.NET Community Toolkit

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • James Montemagno introduces the .NET Community Toolkit and shows examples of how it greatly simplifies your MVVM code including WPF, .NET MAUI, Xamarin.Forms, and more.
    Chapters
    00:00 - Introduction and an overview of the .NET Community Toolkit
    04:55 - Community Toolkit GitHub page
    05:00 - Review of demo starting code
    08:30 - Install the CommunityToolkit.Mvvm NuGet package
    10:00 - Using the INotifyProperyChanged attribute
    12:30 - Inheriting from ObservableObject
    13:20 - Using the Using the AlsoNotifyChangeFor attribute
    17:10 - Using the ICommand attribute
    20:45 - Using the latest C# features in a .NET Framework app
    23:10 - Wrap-up
    Recommended resources:
    Introducing the .NET Community Toolkit (On .NET show episode) - docs.microsoft.com/en-us/show...
    Community Toolkit GitHub page - github.com/communitytoolkit
    .NET MAUI Workshop - github.com/dotnet-presentatio...
    MVVM Source Generators demo code - github.com/jamesmontemagno/MV...
    James on TH-cam: / jamesmontemagno
    #dotnet #visualstudio #mvvm
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    love Robert's office , lovely doors . Very cozy place .

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

    Great video, James! Thank you for doing this sample in WPF! There is a ton of this kind of application! Keep going!

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

    I'm just about to start a new WPF project and you guys have just saved me a ton on work! Thanks!

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

    Hi, thank you for the video James. I was searching this for two days and I could't understand until I watched this :)

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

    Mind Blown. Thank you for sharing!

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

    Oh jame's, it's beautiful ❤️

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

    Very very nice

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

    very very nice thanks ..

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

    Amazing!!!

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

    Good stuff

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

    That's amazing

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

    Robert deserves an Oscar for his acting.😆

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

    Currently MAUI is not available in the regular VS. It is only for preview mode, when is the availability is going to be in general channel of VS?

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

    great

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

    James, I didn't get you when you said that when we cannot inherit from another class then use "[INotifyPropertyChanged]", if we can, then use inheritance from "ObservableObject". Is it correct? If yes, could you talk about why? Thank you so much! Video time is 12:21 .

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

      Yeah for example... let's say you inherit from your own base class called "MyBaseClass"... well you couldn't inherit from "ObservableObject" at the same time, so this is where you would use "[INotifyPropertyChanged]"

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

      Nice! Thank you so much @@JamesMontemagno !

  • @lynnbennett9007
    @lynnbennett9007 6 หลายเดือนก่อน

    With no more support for VS for Mac, how do we install the community toolkit to VS Code on Mac?

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

    In minute 6:20 you said don't put the DataContext there. What did you mean by that?

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

    With Xamarin.Forms, I am used to using the code behind page class as the view model since it already implements INotifyPropertyChanged. Therefore, I would just set the BindingContext = this and life was good. I attempted to do the same thing with MAUI and with these new code generators. Unfortunately, it doesn't work. It looks like the implementation of INotifyPropertyChanged is slightly different between MAUI Pages and the CommunityToolkit. The end result is: cannot convert from 'System.ComponentModel.PropertyChangedEventArgs' to 'string'. Can this be fixed? I find using the Page class as the ViewModel very convenient as that means one less class to deal with. But perhaps this is bad practice?

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

      I added a Xamarin.Forms sample in tehre so take a look at the source code :)

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

      @@JamesMontemagno my question is regarding MAUI, not Xamarin.Forms. Also, my question is regarding using the Page class as the view model for itself, BindingContext = this; your sample does not address my question.

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

    This toolkit espcially targets MVC Web Application developers, right? So I can ignore it as a Blazor dev?

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

    Please, links to this repo

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

    I would love to know When it would come to maui, last time I tried to use it it didn’t work at all

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

      It works perfect with .NET MAUI as I mentioned and have in the sample repo: github.com/jamesmontemagno/MVVMSourceGenerators

  • @dalli-photo
    @dalli-photo 2 ปีที่แล้ว

    Hi, great video! Do you have a navigation example for WPF?

    • @bity-bite
      @bity-bite 2 ปีที่แล้ว

      Everyone does navigation in MVVM differently, go with the way that you feel comfortable with.

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

      Yeah the toolkit isn't a framework just helpers and works with every application. So navigation is up to you.

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

    I love helper functions! But I always get imposter syndrome, "how can something so easy, be so good?"

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

    Don't you just love magic codes

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

    Ok now I ll get more stupid using this MVVM thing

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

    wouldn't it be wonderful if you had at least a single sample that u could actually clone from git and compile without throwing visual studio into a shock! the mvvm project is broken, same with the maui sample. just the time spent trying to resolve these conflicts makes you wonder...

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

      Would love to know what issues you are running into. I pulled the source code and is workign just fine. I did a few small tweaks today for styles, but in general working on my machines. please open an issue, but also make sure you are up to date on Visual Studio 2022 previews

  • @James-rx5eb
    @James-rx5eb 2 ปีที่แล้ว

    Could you provide an example of using attributes to achieve something like a RelayCommand with a CanExecute changed? i.e. You can't hit `Submit` until `!string.IsNullOrWhiteSpace(FullName)` ?

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

    Amazing!