is it possible to have partial xaml like partial class? is it possible to have partial xaml like partial class? wpf wpf

is it possible to have partial xaml like partial class?


There are some possibilites, although it may not be exactly what you think about.

You may outsource ressources by means of a ResourceDictionary. This is very convenient for styles and templates. Of course you have to organize your XAML such that you could benefit of it (use ControlTemplates for instance).

Furthermore you could create UserControls that encapsulate parts of your XAML. This depends on your layout, though.

These parts can be organized in assemblies, which you refer to by references known to XAML via xmlns:??? declarations.


One technique that I have used successfully is to create a parent class that inherits UserControl and I use that as my base xaml class. This allows me to centralize functions like 'onLoad', 'onDataContextChange', etc. Between that and using resource dictionaries I've been able to keep my code much more streamlined.