When developing software in WPF, I always need the following three types of windows:
- OK / Cancel buttons for data windows;
- OK / Cancel / Apply buttons for application settings / options;
- Close button on windows for action windows.
Creating these windows is just boring and the steps are always the same:
- Create a WrapPanel at the bottom of the window
- Add the buttons with the same RoutedUICommand objects over and over again
The attached class makes it much easier to create these basic windows, simply by specifying the mode of the Window. By using this window, you can concentrate on the actual implementation and you don’t have to worry about the implementation of the buttons itself, which saves you time!

Using the class is very easy. Simply derive the Window class from DataWindow instead of Window. The demo application should give you enough information on how to proceed.
20091203 - DataWindow.zip (342.70 kb) [Downloads: 71]