© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•17mo ago•
10 replies
intee_

✅ Invoking an event on property changed (WPF)

Hey all, Just wondering if someone can help me wrap my head around how this works, I am not sure where I am getting caught up but I am sure I am not understanding something. Just started learning WPF and C#. Sorry for the data dump.


I have a text box, a button and a textblock. I am just trying to make the text from the text box be set in the textblock. I have have my bindings working but I don't understand HOW they are working.

I have a
PropertyChangedEventHandler
PropertyChangedEventHandler
in my main window code behind and I have the public and private properties for the binding as well. In the setter of the binding I am calling
 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("DisplayText"));
 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("DisplayText"));


This is where I am getting confused I think. When a property is changed on the UI the properties setter is called by that event handler (Handled by INotifyPropertyChanged) (???) How exactly does this part of it work?

I'm not using any relay commands or anything like that, just straight data binding from the UI to the code behind.

Hope this makes at least a little sense...
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Property Changed
C#CC# / help
4y ago
❔ EVENT ON TEXT CHANGED
C#CC# / help
4y ago
WPF CollectionView Filter on Property of Model?
C#CC# / help
17mo ago