Directory Freebies VS CheatSheet Forum

RSS

Email

Translate

Home About Archive Privacy Contact Advertise Write for Dev102
Posted by Amit on Mar 10th, 2009 | Filed under .Net, C#, WPF | Leave a Comment

Hi

 

A while ago Shahar wrote an article about whether WPF Data Binding is Thread safe. Shahar’s findings were that Even if you change a property from a different thread the PropertyChanged event will be called on the UI Thread making Binding Thread Safe.

I have created a Window with 2 TextBlocks, one of them is binded to a Dependency Property and the other is binded to a regular property:

The Window:

   1: <StackPanel>
   2:     <TextBlock Text="{Binding DpTxt}" Width="100" Margin="5"></TextBlock>
   3:     <TextBlock Text="{Binding Txt}" Width="100" Margin="5"></TextBlock>
   4:     <Button Content="Change Text" Margin="5" Click="Button_Click"></Button>
   5: </StackPanel>


Continue Reading...
Write Article for Dev102

Write for Dev102!

We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution

Learn More