■ Style 클래스 : BasedOn 속성을 사용해 스타일 상속하기

------------------------------------------------------------------------------------------------------------------------

<Style x:Key="BaseTextBlockStyleKey" TargetType="TextBlock">

    <Setter Property="FontFamily" Value="Times New Roman" />

    <Setter Property="FontSize"   Value="24"              />

</Style>

<Style x:Key="GgradientTextBlockStylekey" TargetType="TextBlock" BasedOn="{StaticResource BaseTextBlockStyleKey}">

    <Setter Property="Foreground">

        <Setter.Value>

            <LinearGradientBrush>

                <GradientStop Offset="0" Color="Red" />

                <GradientStop Offset="1" Color="Blue" />

            </LinearGradientBrush>

        </Setter.Value>

    </Setter>

    <Setter Property="FontSize" Value="96" />

</Style>

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요