We pay for user submitted tutorials and articles that we publish. Anyone can send in a contributionLearn More
Here is a problem that one of my colleagues who is just starting to use WPF got himself into. He was working on an application that displays items using an ItemsControl and uses a DataTemplate. Inside the DataTemplate he used an Image. Here is the Xaml code:
This is a much simpler example, but the principal is the same.
Can you see what was he doing wrong?
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:
Where do you locate your convertors? do you put them in the Window.Resources section? or in the UserControl they are being used for? Neither of these options is good. You should put it in the App.Xaml file and here is why:
Lets look at the following example:
Here is our Window:
This is a list of 10 great shortcuts me and my co workers use frequently, we thought you all should know too. Here they are: CTRL + ".": This is actually a shortcut for a shortcut. it is the same as CTRL + SHIFT + F10 which opens the smart tag window and allows you […]
Here is an interesting thing that happened to me at work. For various reasons the application i am working on has a Windows Form in its base, and most of the controls are WPF, part of them are WinForms. The weirdest thing happened to me as i was trying to open a WPF Window from […]
Copyright © 2012 Dev102.com
Breeze : Designed by Amit Raz and Nitzan Kupererd