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

728x90
반응형
728x170

TestProject.zip
다운로드

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="800"
    Height="600"
    Title="BulletDecorator 엘리먼트 사용하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Window.Resources>
        <Style TargetType="{x:Type BulletDecorator}">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin"            Value="10"     />
        </Style>
        <Style x:Key="BulletRectangleKey" TargetType="{x:Type Ellipse}">
            <Setter Property="Width"  Value="12"         />
            <Setter Property="Height" Value="12"         />
            <Setter Property="Stroke" Value="DarkGray"   />
            <Setter Property="StrokeThickness" Value="1" />
            <Setter Property="Fill">
                <Setter.Value>
                    <LinearGradientBrush
                        StartPoint="0 0"
                        EndPoint="1 1">
                        <GradientStop Offset="0"   Color="Blue"  />
                        <GradientStop Offset="0.5" Color="White" />
                        <GradientStop Offset="1"   Color="Blue"  />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BulletTextBlockKey" TargetType="{x:Type TextBlock}">
            <Setter Property="Margin"              Value="10 0 0 0" />
            <Setter Property="HorizontalAlignment" Value="Left"     />
        </Style>
    </Window.Resources>
    <Grid>
        <StackPanel
            HorizontalAlignment="Center"
            VerticalAlignment="Center">
            <BulletDecorator>
                <BulletDecorator.Bullet>
                    <Ellipse Style="{StaticResource BulletRectangleKey}" />
                </BulletDecorator.Bullet>
                <TextBlock Style="{StaticResource BulletTextBlockKey}">항목 1</TextBlock>
            </BulletDecorator>
            <BulletDecorator>
                <BulletDecorator.Bullet>
                    <Ellipse Style="{StaticResource BulletRectangleKey}" />
                </BulletDecorator.Bullet>
                <TextBlock Style="{StaticResource BulletTextBlockKey}">항목 2</TextBlock>
            </BulletDecorator>
            <BulletDecorator>
                <BulletDecorator.Bullet>
                    <Ellipse Style="{StaticResource BulletRectangleKey}" />
                </BulletDecorator.Bullet>
                <TextBlock Style="{StaticResource BulletTextBlockKey}">항목 3</TextBlock>
            </BulletDecorator>
            <BulletDecorator>
                <BulletDecorator.Bullet>
                    <Ellipse Style="{StaticResource BulletRectangleKey}" />
                </BulletDecorator.Bullet>
                <TextBlock Style="{StaticResource BulletTextBlockKey}">항목 4</TextBlock>
            </BulletDecorator>
            <BulletDecorator>
                <BulletDecorator.Bullet>
                    <Ellipse Style="{StaticResource BulletRectangleKey}" />
                </BulletDecorator.Bullet>
                <TextBlock Style="{StaticResource BulletTextBlockKey}">항목 5</TextBlock>
            </BulletDecorator>
        </StackPanel>
    </Grid>
</Window>
728x90
반응형
그리드형
Posted by 사용자 icodebroker
TAG , ,

댓글을 달아 주세요