Wpf label content not updating

The reason for that is that the Label can host any kind of control directly inside of it, instead of just text.This content can be a string as well though, as you will see in this first and very basic example: Another thing you might notice is the fact that the Label, by default, has a bit of padding, allowing the text to be rendered a few pixels away from the top, left corner.

As already mentioned, the Label control allows you to host other controls, while still keeping the other benefits.

The Text Block only allows you to render a text string, while the Label also allows you to: The last bullet point is actually one of the main reasons for using a Label over the Text Block control.

Whenever you just want to render simple text, you should use the Text Block control, since it's lighter and performs better than the Label in most cases.

application works on the principle of Thread affinity which means other threads can't interact with each other. Sometimes developers need to manage the thread or update WPF UI.

Sometime in the past, a friend asked me how to update a control to show status while his code is doing a loop of stuff.

Leave a Reply