至于我能理解你需要一些控制,可以显示动态内容(文本/图片)。我可以建议你使用内容控件,根据当前的数据上下文选择其内容DataTemplate。 我会在几分钟内提出一个完整的解决方案。
<ContentControl Content="{Binding CurrentControlContent.Content}">
<ContentControl.Resources>
<DataTemplate DataType="{x:Type soSandBoxListView:SingleTextModel}">
<TextBlock Text="{Binding SingleModelContent}" Background="Tan"></TextBlock>
</DataTemplate>
<DataTemplate DataType="{x:Type soSandBoxListView:MultipleTextModel}">
<StackPanel>
<TextBlock Text="{Binding FirstName}" Background="Yellow"></TextBlock>
<TextBlock Text="{Binding LastName}" Background="Red"></TextBlock>
<!--use the binding to your picture presentation in model-->
<Image Source="Resources/yotveta.jpg" Stretch="None"></Image>
</StackPanel>
</DataTemplate>
</ContentControl.Resources>
</ContentControl>
问候
非常感谢您的回答,先生。这可以使用Windows窗体完成吗? –
@OkwuPrecious嗨,我确定在winforms中有这样做的能力,但我无法帮助你。对不起;)。 – Ilan