0
我已經有了一個基礎樣式爲什麼我的TextBlock樣式不能從我的基礎樣式繼承?
<Style x:Key="BaseFontControl" TargetType="{x:Type Control}">
<Setter Property="FontSize" Value="13"/>
</Style>
和一個TextBlock的風格,我不能使用樣式上面基地風格。它說Target type TextBlock is not convertable to base type Control
。我該如何解決這個問題?
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../XAMLStyles/BaseFontControl.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="TextStyle" BasedOn="{StaticResource FontControl}" TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="FontFamily" Value="DroidSans"/>
<Setter Property="Foreground" Value="#000000" />
</Style>