开发者

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

开发者 https://www.devze.com 2023-01-03 17:13 出处:网络
I want to crea开发者_高级运维te a master XAML file which includes a bunch of other XAML files. Is this possible?In your main Xaml, use a ItemsControl balise and for the Xaml composant, you must define

I want to crea开发者_高级运维te a master XAML file which includes a bunch of other XAML files. Is this possible?


In your main Xaml, use a ItemsControl balise and for the Xaml composant, you must define your project with UserControl in place of Window

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

In your code, you just need to write this:

Plugins.Items.Add(UserControl);

Maybe you can learn something about MEF for the loading of all yours Xaml

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号