Reputation: 5072
Is there a way to inherit from a WPF Window or UserControl that has XAML associated wit it?
Thanks
Upvotes: 0
Views: 208
Reputation: 6152
Noope. Only the most derived class can be associated with the XAML. This is because the XAML system instantiates the code-behind instance. You can inherit from non-XAML associated UserControl and Control base classes.
The recommended approach for separating the code inheritance vs. the look and feel inheritance is to use custom styles. These have inheritance via the BasedOn attribute.
Upvotes: 1