0

I'm a quite new in WPF...

My application reads data from an external device.
When data is ready I have to add a TabItem to a TabControl and, inside it, create a control which reads its xaml file at runtime (because I have a different layout for each customer).

Which is the best approach to do it?

Regards,
Daniele.

4

1 回答 1

1

呃,不要尝试这样的事情。使用DataTemplatesand aDataTemplateSelector代替。

为每个客户创建一个DataTemplate。您应该有一个具有属性的 VM,该属性提供了DataTemplateSelector决定DataTemplate加载哪个所需的信息。您可以在此处找到针对您的具体案例的示例。

于 2013-07-25T07:13:11.513 回答