첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
본 블로그는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 블로그 콘텐츠 향상을 위해 쓰여집니다.

728x90
반응형
728x170

TestProject.zip
다운로드

▶ MainPage.xaml

<Page x:Class="TestProject.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Page.Resources>
        <x:String x:Key="StringKey">속성 바인딩</x:String>
        <Style TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Times New Roman" />
            <Setter Property="FontSize"   Value="48"              />
        </Style>
    </Page.Resources>
    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <TextBlock
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            FontFamily="Portable User Interface" 
            FontSize="48"
            Text="{StaticResource StringKey}" />
        <TextBlock Name="topTextBlock"
            HorizontalAlignment="Center"
            VerticalAlignment="Top"
            Text="Top Text">
            <TextBlock.Foreground>
                <LinearGradientBrush>
                    <GradientStop Offset="0"    Color="Red"    />
                    <GradientStop Offset="0.17" Color="Orange" />
                    <GradientStop Offset="0.33" Color="Yellow" />
                    <GradientStop Offset="0.5"  Color="Green"  />
                    <GradientStop Offset="0.67" Color="Blue"   />
                    <GradientStop Offset="0.83" Color="Indigo" />
                    <GradientStop Offset="1"    Color="Violet" />
                </LinearGradientBrush>
            </TextBlock.Foreground>
        </TextBlock>
        <TextBlock
            HorizontalAlignment="Left"
            VerticalAlignment="Center"
            Foreground="{Binding ElementName=topTextBlock, Path=Foreground}"
            Text="Left Text" />
        <TextBlock
            HorizontalAlignment="Right"
            VerticalAlignment="Center"
            Foreground="{Binding ElementName=topTextBlock, Path=Foreground}"
            Text="Right Text" />
        <TextBlock
            HorizontalAlignment="Center"
            VerticalAlignment="Bottom"
            Text="Bottom Text">
            <TextBlock.Foreground>
                <Binding ElementName="topTextBlock" Path="Foreground" />
            </TextBlock.Foreground>
        </TextBlock>
    </Grid>
</Page>
728x90
반응형
그리드형(광고전용)
Posted by 사용자 icodebroker
TAG , ,

댓글을 달아 주세요