Thursday, January 21, 2016

Simple WPF reference solution

Did you ever wonder what might be a nice and basic skeleton of a simple WPF application?
Did you ever have that desire to find a basic WPF project, that you could use as a reference if you ever forgot something?
Did you ever have that feeling, when working for several months, or maybe years, with a technology, then switching to another one for some time (completely different), and returning to the previous one, that you are technologically lost even in the most simple things?

I can say for sure that I did, and because of this, I propose to you a solution that I've built for several years, for myself, based on my experience on small but live projects.

The history started several years ago, when I needed to work on WPF projects, then switching to something else, then coming back and not remembering how to do things, and AGAIN searching the WEB, the stackoverflow, finding solutions and wasting valuable time.
One day, I've said to myself: that must stop! I need to gather all information I need, create a simple reference project for myself, and when I don't know something, I just open it, and look how I've done something before.

Now, I think, has come the time to share this little project with others.
It does not contain everything though, but most basic ideas, and I will be grateful for any comment/suggestion that you'll might have.

The solution was re-created for Visual Studio 2013, and contains the following projects:
WPF_MVVM contains the main window.
XMightCommon contains all generic non UI code, that can be reused in many projects.
XMightUICommon contains all generic UI code, that can be reused in many projects.

Topics covered in the solution:
  1. Creation of a WPF window
  2. ViewModel
  3. Binding
  4. RelayCommand
  5. UserControl with INotifyPropertyChanged
  6. Dependency Properties
  7. Resource dictionaries
  8. Animation
  9. Resources
  10. Control Templates
  11. Converters
  12. Custom StartupUri
  13. Busy/Loading animation while executing action.
  14. Logging to UI console
  15. log4net
  16. RollingFileAppender

I wish this project to be useful to you and if you find it useful, I will be grateful for any acknowledgement!

Source