WPF INotifyPropertyChanged and Databinding

Поделиться
HTML-код
  • Опубликовано: 2 июн 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...
  • НаукаНаука

Комментарии • 98

  • @_buffer
    @_buffer  2 года назад +4

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

    • @bohdanfilas
      @bohdanfilas 2 месяца назад

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

  • @selmanalfaris3544
    @selmanalfaris3544 2 года назад +8

    Waiting for more wpf design videos 🔥

    • @_buffer
      @_buffer  2 года назад +6

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

  • @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! :-)

  • @rays7834
    @rays7834 2 года назад +3

    Please make tutorials more often, the are very useful

    • @_buffer
      @_buffer  2 года назад +1

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

    • @rays7834
      @rays7834 2 года назад +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  2 года назад

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

  • @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! :-)

  • @ContentPiano
    @ContentPiano 2 года назад

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

  • @Lena1398
    @Lena1398 2 года назад +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  2 года назад +1

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

  • @foxspawn4551
    @foxspawn4551 2 года назад +3

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

    • @_buffer
      @_buffer  2 года назад

      Thank you so much!! :-)

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

  • @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! :-)

  • @rogerpence
    @rogerpence 2 года назад +1

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

    • @_buffer
      @_buffer  2 года назад

      Thank you sir! :-)

  • @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! :-)

  • @hassanhilaly8810
    @hassanhilaly8810 2 года назад +1

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

    • @_buffer
      @_buffer  2 года назад

      You're most welcome! :-)

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

  • @thomasaminer
    @thomasaminer 14 часов назад

    Thank you for the video!

  • @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! :-)

  • @rsetty33
    @rsetty33 Год назад

    Very nice explanation.. Thank you

  • @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! :-)

  • @anils469
    @anils469 Год назад

    Thanks Bro, Great video

  • @juancarlosrodriguez4969
    @juancarlosrodriguez4969 7 месяцев назад

    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 😁🤩

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

  • @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!

  • @amitskhandelwal
    @amitskhandelwal 2 года назад

    Best explanation ever

  • @morek3766
    @morek3766 2 года назад +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  2 года назад +2

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

    • @FiveNineO
      @FiveNineO 2 года назад

      Great suggestion 👍

  • @Talking2Wall
    @Talking2Wall Год назад

    You're the BEST!

  • @ringoffaia639
    @ringoffaia639 2 года назад +1

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

  • @thanthiek2011
    @thanthiek2011 10 месяцев назад +1

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

    • @_buffer
      @_buffer  9 месяцев назад

      You're most welcome!

  • @diederikdesoete9615
    @diederikdesoete9615 2 года назад

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

  • @GuildOfCalamity
    @GuildOfCalamity 2 года назад +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  2 года назад +1

      That's a great idea! :-)

    • @GuildOfCalamity
      @GuildOfCalamity 2 года назад

      @@_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  2 года назад +1

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

  • @botabbueu51
    @botabbueu51 Год назад

    Du är grym!

  • @zGAMERz111
    @zGAMERz111 Год назад +2

    you're a legend

    • @_buffer
      @_buffer  Год назад +1

      No, that's all you!

  • @tobiassjoholm9325
    @tobiassjoholm9325 2 года назад +1

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

  • @musabalriani550
    @musabalriani550 Год назад

    We'll be more than happy ,with MVVM Video

  • @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 :-)

  • @marpta6675
    @marpta6675 2 года назад +1

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

  • @kpbarker
    @kpbarker Год назад

    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.

  • @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 ! ^^

  • @cr0lg8or56
    @cr0lg8or56 2 года назад +2

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

    • @_buffer
      @_buffer  2 года назад +1

      That can be arranged! :-)

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

  • @skeych
    @skeych 2 года назад +1

    Simple good video

    • @_buffer
      @_buffer  2 года назад

      Thank you! I really do appreciate that :-)

    • @skeych
      @skeych 2 года назад +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  2 года назад

      @@skeych Do you use Discord?

    • @skeych
      @skeych 2 года назад

      @@_buffer yeap

    • @skeych
      @skeych 2 года назад

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

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

  • @YBXtreminal
    @YBXtreminal 2 года назад +3

    Please do about input validation in TextBox

    • @_buffer
      @_buffer  2 года назад +1

      Good idea! :-)

    • @YBXtreminal
      @YBXtreminal 2 года назад +2

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

  • @FarooqAhmad-lr1fx
    @FarooqAhmad-lr1fx Год назад

    Nice toturial. but how we can save it further?

  • @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 2 года назад +2

    Lol, he's using Windows 11

    • @_buffer
      @_buffer  2 года назад

      I sure am :-)