I am trying to define common behaviours between windows in a WPF application, for example:
All dialogs need to have certain properties set a certain way and respond to the escape key in order to close.
Is there any way to inherit from a shared base class? The xaml kicks up a fuss every time I attemp this by including the namespace in the xaml.
Thank you.
Sounds like what you really want is a common style for your Windows, see here for a discussion around the topic: How to set default WPF Window Style in app.xaml?
If you still want to use a base window class, below works for me:
XAML:
Code behind: