RSS

Monthly Archives: February 2014

Getting started with WPF

I have started working on WPF (Windows Presentation Foundation) since a couple of weeks and been going through some learning. WPF has been around for a long time (probably since .NET 3.0 time frame). What I am trying to post in this blog post is a list of readings which are recommended by my colleagues and the one which I found through reading on-line.

Suggestions and on-line readings:

1. A good blog from John Smith about WPF and MVVM

2. Keep UI layer as thin as possible. No data manipulation in xaml.cs(as much as can be avoided). UI layer should be dumb. Move all complex data logic to view model.

3. Try to use data binding in xaml file as much as possible. Avoid adding code in xaml.cs file(C# layer for the UI should be thin). Instead add those UI logic in xaml file itself.

4. Use data converters

5. Keep the styles and data templates separate from the layout as much as possible. Then use those as StaticResource / DynamicResource wherever applicable. This ensures better reusability.

6. Define custom controls whenever necessary. Default controls may not always be perf-efficient.

7. WPF can cause memory issues if we are not careful. Detach any event handlers that we may have attached during UI loading / initialization. Dispose any IDisposable objects. Ref1 Ref2

8. One can find good tutorials on PluralSight.com

9. WPF Interview Question – This has real good questions which gives you an overview of various high level topics in WPF

10. XAML Guidelines

11. XAML Guidelines and Best Practices – This link has points to channel9 videos on XAML Guidelines

Once you get a good hang of these concepts, you would have real fun working on some good UI.

As a request always. Please do share links to interesting WPF UI examples/samples/blogs/new-concepts etc which you came across.

Good luck

Advertisements
 
Leave a comment

Posted by on February 4, 2014 in Uncategorized