When you bind to the Address object itself, the object itself, that is, its identifier, does not change, even if its properties are satisfied. Therefore, WPF does not know to update the binding in this case.
So yes, you need to bind to the notification property (or properties), and not to the entire object. As you say, one way to do this is to create a DisplayText property and raise a PropertyChanged event for this property whenever something affects the display text. Another is the use of several text blocks in a horizontally oriented StackPanel, each of which is tied to a specific property, for example.
<StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding HouseNumber}" /> <TextBlock Text=", " /> <TextBlock Text="{Binding Street}" /> <TextBlock Text=", " /> <TextBlock Text="{Binding City}" /> </StackPanel>
The advantage of the second approach is that it gives you flexibility in the user interface to change the way addresses are displayed, for example. multiple lines, formatting, etc .; The downside is that it gets complicated if you have conditional logic, for example. optional flat number or second address bar.
source share