设为首页 加入收藏

TOP

xaml中Style的继承
2017-10-11 16:05:03 】 浏览:2788
Tags:xaml Style 继承

语法

        <Style x:Key="tb1" TargetType="TextBlock">
            <Setter Property="FontSize" Value="30"/>
            <Setter Property="Foreground" Value="Red"/>
        </Style>
        <Style x:Key="tb2" TargetType="TextBlock" BasedOn="{StaticResource tb1}">
            <Setter Property="Foreground" Value="Green"/>
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>

 

当某个基准样式与 BasedOn 样式具有同一个属性时,将使用在 BasedOn 样式中设置的属性值。

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇04.移动先行之谁主沉浮----XAML的.. 下一篇04.移动先行之谁主沉浮----XAML的..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目