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