Is there a way to include XAML files in another XAML file?

I want to create a XAML master file that includes a bunch of other XAML files. Is it possible?

+4
source share
1 answer

In the main Xaml, use the ItemsControl balice and for the Xaml linker, you must define your project using UserControl instead of Window

<ItemsControl x:Name="Plugins" x:FieldModifier="private" Height="auto"> 

In your code you just need to write this:

 Plugins.Items.Add(UserControl); 

Perhaps you can learn something about MEF to download all your Xaml

0
source

Source: https://habr.com/ru/post/1313124/


All Articles