3
我有一個ResourceDictionary列出了我的wpf應用程序中使用的不同樣式。在資源字典中共享datatemplate的一部分wpf
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DataTemplate x:Key="TemplateA">
<Some A specific definitions />
<StackPanel>
<!-- Same content as other templates -->
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="TemplateB">
<Some B specific definitions />
<StackPanel>
<!-- Same content as other templates -->
</StackPanel>
</DataTemplate>
等等
現在我該怎樣共享相同的ResourceDictionary跨越TemplateA和TemplateB相同的StackPanel內容?
我很抱歉如果我缺少一些簡單的東西,因爲這是我第一次學習WPF。 感謝
謝謝HighCore! – theOne