13
我在app.xaml中有一个DataTemplate,它将视图绑定到视图模型。app.xaml中的datatemplate没有被拾取而没有任何样式?
<Application.Resources>
<DataTemplate DataType="{x:Type vm:someviewmodeltype}">
<vw:somevwcontrol />
</DataTemplate>
</Application.Resources>
如果没有样式,则上述模板不适用。我把一种风格,像那一刻...
<Application.Resources>
<DataTemplate DataType="{x:Type vm:someviewmodeltype}">
<vw:somevwcontrol />
</DataTemplate>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="20"></Setter>
</Style>
</Application.Resources>
的DataTemplate被拾起并产生期望的结果...我不知道发生了什么有...可能有人澄清这一点?
谢谢。
花了一整天的时间寻找这个。解决了! – JvdBerg 2015-04-29 16:16:01