WPF INotifyPropertyChanged and Databinding

Поділитися
Вставка
  • Опубліковано 26 лип 2024
  • WPF INotifyPropertyChanged and Databinding what is the INotifyPropertyChanged interface and databinding in wpf how do I databind using wpf this is a tutorial showing you how to implement the inotifypropertychanged event as well as how to use databinding using WPF and C# in Visual Studio 2022, this ia tutorial showing you how to code using C# while using wpf and databinding adding the INotifyPropertyChanged interface and implementing it.
    Patreon: / payloads
    Visual Studio 2022 visualstudio.microsoft.com/vs...
  • Наука та технологія

КОМЕНТАРІ • 99

  • @_buffer
    @_buffer  3 роки тому +4

    There is now an official Discord server!
    discord.gg/2RNRx73aDE

    • @bohdanfilas
      @bohdanfilas 4 місяці тому

      Make as many useful recordings as possible, because I like them very much and keep it up (Greetings!) 🙂

  • @TalisBarbalho
    @TalisBarbalho 2 роки тому +4

    just found out this channel recently as I started to study wpf and c#.
    each video is like a gold mine.
    Thanks for sharing your knowledge and time

    • @_buffer
      @_buffer  2 роки тому

      Thank you so much! I appreciate you a lot! :-)

  • @selmanalfaris3544
    @selmanalfaris3544 3 роки тому +8

    Waiting for more wpf design videos 🔥

    • @_buffer
      @_buffer  3 роки тому +6

      More on the way! Got a few lined up! :-)

  • @TheUltraBlender
    @TheUltraBlender 2 роки тому +4

    Man, you just continue to amaze me. With a lot of tutorials i feel like they don't give you enough info or even worse, way too much. Then i end up going down the rabbithole and getting frustrated because i understand even less.
    And then there's your stuff giving just enough information to use the explained topic effectively but also having a few points to hook on if you want to dive deeper.
    You really got a talent for teaching, thanks for sharing and wish you all the best.

    • @_buffer
      @_buffer  2 роки тому +1

      Wow! That means a lot! I really do appreciate that! It's stuff like this that makes keeps me motivated to make more and more videos! :-)

  • @DyslexicAnaboko
    @DyslexicAnaboko Рік тому +1

    I can't thank you enough! I have been working on the same stupid problem for hours and you just pointed out what I was missing all this time. I have a three tier Tree View control so it's getting very involved. All I wanted to do was make the UI update when the 2nd tier's check box was toggled to update the 3rd tier's list of check boxes. Your rudimentary Select all / Deselect all. I implemented the INotifyPropertyChanged in one of my classes, but I didn't realize you had to do it in all affected view models. That was the part I was missing! So incredibly not obvious. Your explanation was perfect, thank you!

    • @_buffer
      @_buffer  Рік тому

      I'm glad you found it useful! I hope the project goes well! :-)

  • @rays7834
    @rays7834 3 роки тому +3

    Please make tutorials more often, the are very useful

    • @_buffer
      @_buffer  3 роки тому +1

      More coming! Do you have any suggestions? What would you prefer to see?

    • @rays7834
      @rays7834 3 роки тому +1

      @@_buffer you have such a very cool playlist about how to programming on C#. Also it will be interesting to know more about Blazor and ASP.NET, thank you!
      *And maybe to make more examples, how to use something, maybe 2 more examples in this video of how and where I can use INPC.

    • @_buffer
      @_buffer  3 роки тому

      @@rays7834 Those are all great ideas! Thank you! :-)

  • @zaxa.6044
    @zaxa.6044 2 роки тому +1

    Great tutorial thank you very much ! Clear theory explanation + great coding example !

  • @ringoffaia639
    @ringoffaia639 2 роки тому +1

    11:24 Yes please make a video detailing how it works under the hood

  • @freestyle88
    @freestyle88 Рік тому +1

    Man, I've been trying for hours to get one stupid checkbox to update in the UI when a boolean property changes in the background... Could not find a decent explanation of how to implement OnPropertyChanged until I found this -- that [CallerMemberName] trick is definitely needed there if checking a boolean rather than a string... and it works like a champ. Thank you!

    • @_buffer
      @_buffer  Рік тому

      Heck yeah Matt! Well done! :-)

  • @foxspawn4551
    @foxspawn4551 3 роки тому +3

    This is great!
    Love the presentation style and pace.
    Subbing for more WPF / C# content!

    • @_buffer
      @_buffer  3 роки тому

      Thank you so much!! :-)

  • @Lena1398
    @Lena1398 3 роки тому +2

    Great Video, very nicely explained and presented, thanks a lot! Your videos are my favourite WPF tutorials I found anywhere, it really helped me. Excited for all future content.

    • @_buffer
      @_buffer  3 роки тому +1

      Thank you so much! I really do appreciate it! And more content coming! :-)

  • @WDGKuurama
    @WDGKuurama Рік тому +1

    I was hardstuck on it, but then i found your video, thanks!

    • @_buffer
      @_buffer  Рік тому

      You're most welcome! I'm glad you found it useful! :-)

  • @rogerpence
    @rogerpence 2 роки тому +1

    Wow. Concise and full of sweet info! Great job.

    • @_buffer
      @_buffer  2 роки тому

      Thank you sir! :-)

  • @ContentPiano
    @ContentPiano 2 роки тому

    Thank you for the very clear explanation. Helped a lot!

  • @hassanhilaly8810
    @hassanhilaly8810 2 роки тому +1

    We always continue to learn from you .Thank you for sharing.

    • @_buffer
      @_buffer  2 роки тому

      You're most welcome! :-)

  • @mikedyson3211
    @mikedyson3211 Рік тому +1

    Absolutely First Class video. I recreated it step by step and now have a much better understanding of it. Many thanks!

    • @_buffer
      @_buffer  Рік тому

      Thank you Mike! I'm glad you liked it and managed to follow along! :-)

  • @semidash
    @semidash 2 роки тому

    Thanks a million for the video!!! It really helped me to wrap my head aroud bindings.
    It would be great if you could do more videos on this topic

  • @gugomayora
    @gugomayora 2 роки тому +1

    I love how u r always updated with latest versions.

    • @_buffer
      @_buffer  2 роки тому

      Thank you! I try :-)

    • @gugomayora
      @gugomayora 2 роки тому +1

      @@_buffer may I ask u somehing please... did u studied a University carreer? how did u master C# and .NET development so deep?

    • @_buffer
      @_buffer  2 роки тому +1

      @@gugomayora Good question! It's a combination of both studies and lots of practice, I find learning by doing to be a great method to use in order to get better :-)

    • @gugomayora
      @gugomayora 2 роки тому

      @@_buffer Thank u very much buddy

  • @juancarlosrodriguez4969
    @juancarlosrodriguez4969 9 місяців тому

    Espectacular, se entendió bastante, no alcanzo a entender del todo la parte final, pero fue extremadamente instructivo y útil. Gracias por tu tiempo invertido en estos videos, espero puedas aplicar un ejemplo con el contenido de un combobox dentro de un datagrid 😁🤩

  • @thanthiek2011
    @thanthiek2011 Рік тому +1

    thank you that was the salvation after hours of googling and half-baked explanations

    • @_buffer
      @_buffer  11 місяців тому

      You're most welcome!

  • @thomasaminer
    @thomasaminer Місяць тому +1

    Thank you for the video!

    • @_buffer
      @_buffer  Місяць тому

      You're most welcome! Thanks for the comment :-)

  • @johnquinn1853
    @johnquinn1853 Рік тому +1

    Great video! Thanks!

    • @_buffer
      @_buffer  Рік тому

      You're most welcome!

  • @brandonkish3100
    @brandonkish3100 2 роки тому +1

    Dude this is freaking awesome! Could you do a video explaining the MVVM model? I have struggled with it for a long time. I don't fully understand the relationships between the models, and then how to interface it with the code behind.

  • @rsetty33
    @rsetty33 Рік тому

    Very nice explanation.. Thank you

  • @TheLIMAK8
    @TheLIMAK8 Рік тому +1

    I love this guide, thank you dude

    • @_buffer
      @_buffer  Рік тому

      You're most welcome!

  • @GachiBasster
    @GachiBasster Рік тому +1

    thanks for your videos, man. information in this video so useful for me

    • @_buffer
      @_buffer  Рік тому

      You're welcome! I'm glad you found it useful!

  • @anils469
    @anils469 2 роки тому

    Thanks Bro, Great video

  • @Talking2Wall
    @Talking2Wall 2 роки тому

    You're the BEST!

  • @musabalriani550
    @musabalriani550 Рік тому

    We'll be more than happy ,with MVVM Video

  • @morek3766
    @morek3766 3 роки тому +5

    Great tutorial. Well explained. I was wondering when you’ll do a wpf tutorial that shows how to change pages with smooth transition without losing data for example, while also passing data to the new page. Thanks for sharing once more

    • @_buffer
      @_buffer  3 роки тому +2

      I'd love to do a video on that!It's just matter of keeping the datacontext :-)

    • @FiveNineO
      @FiveNineO 2 роки тому

      Great suggestion 👍

  • @amitskhandelwal
    @amitskhandelwal 2 роки тому

    Best explanation ever

  • @diederikdesoete9615
    @diederikdesoete9615 2 роки тому

    Great video, would love one that goes more in depth.

  • @GuildOfCalamity
    @GuildOfCalamity 3 роки тому +3

    Awesome video. More WPF please!
    Would love to see business logic code driven from the UI binding, e.g. click a button and a webpage downloads (the button would be disabled until the download completed).
    I think this would be a good example to show async thread operations in the background updating the UI in the foreground.

    • @_buffer
      @_buffer  3 роки тому +1

      That's a great idea! :-)

    • @GuildOfCalamity
      @GuildOfCalamity 3 роки тому

      @@_buffer You set a good speed during the tutorial and great editing; not too much detail, but not so vague that you don't know what's going on. Keep up the good work!

    • @_buffer
      @_buffer  3 роки тому +1

      @@GuildOfCalamity I really do appreciate it! Thank you so much! :-)

  • @botabbueu51
    @botabbueu51 Рік тому

    Du är grym!

  • @zGAMERz111
    @zGAMERz111 2 роки тому +2

    you're a legend

    • @_buffer
      @_buffer  2 роки тому +1

      No, that's all you!

  • @cr0lg8or56
    @cr0lg8or56 3 роки тому +2

    Thank for the Videos☻ and talk about taking informations from csv files and bringing them to a xaml DataGrid, pleaaase!1

    • @_buffer
      @_buffer  3 роки тому +1

      That can be arranged! :-)

  • @amitskhandelwal
    @amitskhandelwal 2 роки тому +1

    Please create one video on end to end application development in wpf c# and sql database. presently no such video like such on you tube

  • @tobiassjoholm9325
    @tobiassjoholm9325 2 роки тому +1

    Is possible to use composition instead of inheritance for the notify logic?

  • @kpbarker
    @kpbarker 2 роки тому

    Is it possible to bind dynamically? Creating labels dynamically along with a list of bool values. I'm trying to bind while looping through a for...loop to create a bunch of labels. The bound properties will be contained within a Dictionary.

  • @marpta6675
    @marpta6675 3 роки тому +1

    Great Video, but the problem is when we will have 20 property to change. Have you any idea for that?

  • @YBXtreminal
    @YBXtreminal 3 роки тому +3

    Please do about input validation in TextBox

    • @_buffer
      @_buffer  3 роки тому +1

      Good idea! :-)

    • @YBXtreminal
      @YBXtreminal 3 роки тому +2

      @@_buffer great video, nice to see you again, you have been missed

  • @cosmingugoasa5949
    @cosmingugoasa5949 2 роки тому

    Maaaann almost perfect video 😭 how would this setup change if I'm using a view model between the model and the view ??
    The viewmodel would implement the INotify[...] but how does the link from the model to the view model work?
    Example : I crate a list of persons, I use this list to create the Observable Collection list, then one of the person changes ages (via business logic in the model class) is this change reflected to the ViewModel property to update the ui?

  • @FarooqAhmad-lr1fx
    @FarooqAhmad-lr1fx Рік тому

    Nice toturial. but how we can save it further?

  • @kylerbriskey372
    @kylerbriskey372 Рік тому +3

    Another amazing video! You explained so many things I was confused about over the past year of learning this stuff. Also, the databinding was great to learn too and imma practice this technique often!
    I have a couple questions.
    Q1) If I have different classes in my project, how do set multiple DataContexts. Like If I had PersonModel and AnimalModel in 2 different columns of a grid.
    Q2) That Debug.WriteLine() was new to me bug very cool. Does this only work in Debug mode? but once I build a release of my app, will that code not slow anything down, or do I have to go manually remove it from the code?

    • @_buffer
      @_buffer  Рік тому +2

      Thank you! I'm glad you found it informative! And in terms of setting multiple datacontexts for one class, that's not really recommended, if you're tryint to get data from a different ViewModel that would be bad architecture and I would suggest creating a service that both ViewModels could receive the same type of data from. This could be registered as a service using Dependency Injection for instance, which I recently made a video on.
      And as for the second question, that's correct, if you wanted the same functionality but when in release mode you could use `Trace.WriteLine`. :-)

    • @kylerbriskey372
      @kylerbriskey372 Рік тому +1

      @@_buffer Okay great. I don't know the proper way to architect projects, but I'm slowly learning.
      Thank you

    • @_buffer
      @_buffer  Рік тому +1

      @@kylerbriskey372 One day at a time :-)

  • @skeych
    @skeych 3 роки тому +1

    Simple good video

    • @_buffer
      @_buffer  3 роки тому

      Thank you! I really do appreciate that :-)

    • @skeych
      @skeych 3 роки тому +1

      @@_buffer , np. I have question. I use MVVM, and want to create my own UserControl in code-behind. I make List property, and when in ctor i do this: MyProperty = new List(){ new MyViewModel() { TextProp = "my text" } } - my UserControl will created, but "my text" isn't displayed.

    • @_buffer
      @_buffer  3 роки тому

      @@skeych Do you use Discord?

    • @skeych
      @skeych 3 роки тому

      @@_buffer yeap

    • @skeych
      @skeych 3 роки тому

      @@_buffer if you have discord srverv, i can connect

  • @antoinemoineau1037
    @antoinemoineau1037 2 роки тому +1

    Thank you for this content !
    The thing I can't wrap my head around is that binding doesn't seem to follow the traditional "The class is the blueprint and then you instantiate tangible objects and use those objects to do things". Here it looks like we are working directly with the blueprint. Is the object automatically instantiated by the UI ? How do you handle having multiple objects of the same class ? And how do you bind the same object to different places in the UI (for example a parameters view where you can modify settings on an object that is currently displayed in another view in the UI).

    • @_buffer
      @_buffer  2 роки тому

      Great question! Feel free to join the Discord server! It's a lot easier to explain it over there :-)

    • @antoinemoineau1037
      @antoinemoineau1037 2 роки тому

      @@_buffer Sure ! After posting I actually thought "maybe that would be best asked on the discord server". I joined, I'll ask again there.
      Edit : Btw, thank you for answering so fast ! ^^

  • @enricoroselino7557
    @enricoroselino7557 Рік тому

    .........this should also work in xamarin right ?

  • @haku5957
    @haku5957 Рік тому +1

    Please comeback with MVVM bro

    • @_buffer
      @_buffer  Рік тому

      New MVVM video is being uploaded right now :-)

    • @haku5957
      @haku5957 Рік тому +1

      @@_buffer i dont see it :(

    • @_buffer
      @_buffer  Рік тому +1

      @@haku5957 It's currently processing, it'll be up soon! Feel free to join the Discord meanwhile, I'll post a notification on there when it's up!

    • @_buffer
      @_buffer  Рік тому

      @@haku5957 It's up now :-)

  • @notanenglishperson9865
    @notanenglishperson9865 3 роки тому +2

    Lol, he's using Windows 11