what are the common mistake can be avoided by a WPF developer?
-
Do you mean mistakes when using XAML or are thinking about WPF specifically? – Enrico Campidoglio Jun 10 '10 at 08:25
-
2Do you seek information or reputation? ;-) – AndreasT Jun 10 '10 at 08:27
-
1possible duplicate of [What are the most common mistakes made in WPF development?](http://stackoverflow.com/questions/322612/what-are-the-most-common-mistakes-made-in-wpf-development) – luvieere Jun 10 '10 at 09:03
6 Answers
I think a big mistake would be to ignore the M-V-VM Pattern that should be used by good developers

- 5,745
- 4
- 30
- 41
Treating it like Windows Forms.. Don't do that.. WPF != WinForms..

- 26,677
- 10
- 92
- 107
-
5Sadly most of the WPF Books doesn't even write about the MVVM Pattern to use with WPF. They all write their samples like they were Winforms ... – Mohnkuchenzentrale Jun 10 '10 at 08:33
Putting code (validation, coercion logic, change notifications, logging, etc) in the getters and setters of dependency properties' corresponding CLR properties, instead of using the PropertyChangedCallback
, ValidateValueCallback
and CoerceValueCallback
.
Normal .NET code can get or set the property values through them, but WPF gets and sets these values by going directly to the backing store.
The CLR wrapper should thus look like this:
public int Prop
{
get
{
/*NOTHING IN HERE*/
return (int)GetValue(ThingyProperty);
}
set
{
/*NOTHING IN HERE*/
SetValue(ThingyProperty, value);
/*NOTHING IN HERE*/
}
}

- 37,065
- 18
- 127
- 179
Over-engineering... just because it is possible to do with a complex binding doesn't mean you can maintain it...
EDIT: And doing things in XAML that should be done elsewhere.

- 7,970
- 3
- 36
- 40
Check this out -
What are the most common mistakes made in WPF development? What are the most common mistakes made in WPF development?
-
and this one - http://stackoverflow.com/questions/2597591/common-wpf-pitfalls – akjoshi Jun 10 '10 at 09:14
- Treating it like Windows Forms or ASP.NET
- Ignoring the MVVM Pattern
- Overusing the MVVM pattern in sake of MVVM pattern
- Treating it like Silverlight
- Ignoring XAML coding guidelines -> result in unmaintainable XAML.
- Ignoring Binding errors in Visual Studio Output
- Ignoring Designer in Visual Studio (i.e. WPF application blendability)