I don't get much opportunity to work with WPF anymore which has meant I have lots of code going to waste. One piece of code, which I thought I could share, is around customizing the default window (title bar, window border, window buttons, drag, drop and resize). The approach I took was to encapsulate all the code in behaviors and commands and then use a XAML style for the Window. This way everything is reusable. I've put the following behaviors and commands together into a code sample showing how to create a custom window in WPF and published it on MSDN here. The individual commands and behaviors are listed below.
To see how to use them have a look at the window template in App.xaml. Please feel free to download the sample and use the code in your own projects.