Understanding INotifyPropertyChanged Interface in WPF

Поделиться
HTML-код
  • Опубликовано: 10 ноя 2024

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

  • @kimh.6680
    @kimh.6680 4 года назад +14

    You should use OnPropertyChanged(nameof(FirstName)) instead of OnPropertyChanged("FirstName"), so whenever you rename the FirstName property, the other occurrences will be automatically renamed (or you get a compiler error to indicate that they haven't been).

    • @DhruvShah-n7b
      @DhruvShah-n7b 4 месяца назад

      if you want to go a step further you can use the atttribute [callerMemberName] on argument property of onProprertyChanged and just pass the default as null.and you can use propertychanged anywhere without parameters

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

    I am a bit confused. Once you have set binding property Mode = TwoWay it should occur automatically UI -> Model and back Model -> UI. Why you have to implement this interface in order to get this behaviour? Also, who subscribes to this event and what are the event handlers?

  • @dgloria
    @dgloria 6 лет назад +3

    Hi, I didn't get to the end of the video series, but I couldn't see if you have a tutorial on simple data queries from SQL table, how to do that? I mean not the data bindingof one table, but manipulating data in multiple tables, eg. from a simple form with select, insert and update queries.
    In the old, windows forms environment it was really difficult, I'm hoping they made it easier. Thank you.

  • @shilpamore1345
    @shilpamore1345 4 года назад

    You made it easy,, Thanks

  • @anulekhachatterjee
    @anulekhachatterjee 5 лет назад

    Great video. Thanks a lot

  • @hamarasansarharsh
    @hamarasansarharsh 4 года назад +1

    When and how the PropertyChanged event is initialize?

  • @vishalrockzz1909
    @vishalrockzz1909 3 года назад

    We need not add UpdateSoruceTrigger property in the view for the text boxes?

  • @jaydigging2009
    @jaydigging2009 7 лет назад +1

    Great explanation ! Thank you

  • @dattahembade1150
    @dattahembade1150 5 лет назад

    Thank you so much for this video

  • @orlandoreyes884
    @orlandoreyes884 7 лет назад +4

    I understand that new PropertyChangedEventArgs(....) raise a PropertyChanged event, who is subscribed to this event? The UI??

    • @kimh.6680
      @kimh.6680 4 года назад +1

      Yes. Or to be more precise, the binding of the Text property is subscribed to the event.

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

    Hi. Your example works, but I don't understand why. Why PropertyChanged is not null? Where some method suscribes to it? Where this assignation happens: PropertyChanged+= SomeMethod; ? Thanks

  • @jamesandys7583
    @jamesandys7583 5 лет назад +5

    skipped the actual INotifyPropertyChanged interface altogether, would hv been better to explain how it actually works

  • @padmajavudatha8294
    @padmajavudatha8294 7 лет назад +1

    thank you so much for your video tutorials

  • @yashidhar8574
    @yashidhar8574 6 лет назад

    superb explanation

  • @sushilbhat9431
    @sushilbhat9431 3 года назад

    Can we bind multiple object in datacontex,
    Linke person, studen, etc....

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

      you can but you have to do it in xaml code. If you will try to do it from code behind file datacontext will be set to null.

  • @Trzbne
    @Trzbne 6 лет назад

    Thank you so very much for this video!

  • @aishwaryachavan9004
    @aishwaryachavan9004 3 года назад

    I want to open Excel sheet from a button and edit that Excel sheet and save this modifications. Plz if you guide me for that it'll really help me alot.

  • @studstud5498
    @studstud5498 7 лет назад

    Could you guide me is it code first or database. I am trying to do by doing database first now i donot know how to update database. I think I did some mistake.

  • @ronancasey
    @ronancasey 7 лет назад

    Great tutorial, thanks :)

  • @ajaysingh-zo7hc
    @ajaysingh-zo7hc 4 года назад +1

    Even if OnPropertyChanged("FirstName") and OnPropertyChanged("LastName") statements are removed, the application will work the same.

  • @la-vie-en-rose
    @la-vie-en-rose 7 лет назад +1

    If INotifyPropertyChanged can provide change notification to UI for simple property, why do we need dependency property?

    • @kimh.6680
      @kimh.6680 4 года назад

      When implementing INotifyPropertyChanged, you indeed do not need dependency properties. It's a different way.

  • @HimaniDave-l1m
    @HimaniDave-l1m Год назад

    where i can get code of this video

  • @ziia0528
    @ziia0528 3 года назад

    Why not call ontextchange event in textbox and update the full name textbox.

  • @rajeevmehta5290
    @rajeevmehta5290 8 лет назад

    same thing i can achieved using only data binding then why i need INotifychanged interface. as you explain in the data binding video Target property got changed by changing the source property. Please clarify this.

    • @shilpimittal4322
      @shilpimittal4322 7 лет назад +3

      Suppose somewhere the source property got changed in business logic, then it will not reflect on UI without using INotifyPropertyCHanged.

  • @MarkDanielLouwe
    @MarkDanielLouwe 4 года назад

    thank you!!

  • @WahidRezgui
    @WahidRezgui 6 лет назад +1

    hy, FullName should have only Get no setter

  • @fouadchelfi2590
    @fouadchelfi2590 6 лет назад

    Thank you so much

  • @yashidhar8574
    @yashidhar8574 6 лет назад

    can you make dependency injection video?

  • @somashekharmanjunath7231
    @somashekharmanjunath7231 7 лет назад +1

    Hello DotNetSkool Guru ...Can u pls upload the video on how to make an custom control in WPF.....

  • @mr.es1857
    @mr.es1857 7 лет назад

    is he the guy from bestdotnettraining chanel??

  • @ganesaf6418
    @ganesaf6418 7 лет назад

    Thanks master ^_^

  • @knerduno5942
    @knerduno5942 3 года назад

    It reads Dot New School