相关疑难解决方法(0)

基于不同XAML的样式继承

如何将样式中的BasedOn标记指定为某些其他文件中定义的样式.

例,

Dictionary1.xaml定义

   <Style x:Key="basicStyle" TargetType="TextBlock" >
       <Setter Property="FontSize" Value="24"></Setter>
       <Setter Property="Foreground" Value="DarkGray"></Setter>
       <Setter Property="FontWeight" Value="Bold"></Setter>
    </Style>
Run Code Online (Sandbox Code Playgroud)

在Dictionary2.xaml中我需要类似的东西

    <Style x:Key="headerStyle" TargetType="TextBlock" >
       <Setter Property="FontSize" Value="46"></Setter>
       <Setter Property="Foreground" Value="DarkGray"></Setter>
       <Setter Property="FontWeight" Value="Bold"></Setter>
    </Style>
Run Code Online (Sandbox Code Playgroud)

怎么做到这一点?

.net c# wpf xaml resourcedictionary

13
推荐指数
1
解决办法
8864
查看次数

标签 统计

.net ×1

c# ×1

resourcedictionary ×1

wpf ×1

xaml ×1