728x90
반응형
728x170
■ BulletDecorator 엘리먼트에서 Ellipse 엘리먼트를 불릿으로 사용하는 방법을 보여준다.
▶ 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
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] UIElement 클래스 : DragEnter/GiveFeedback/DragOver/Drop/DragLeave 이벤트를 사용해 드래그하기 (0) | 2020.08.08 |
---|---|
[C#/WPF] Thumb 엘리먼트 : DragStarted/DragDelta/DragCompleted 이벤트를 사용해 드래그 하기 (0) | 2020.08.08 |
[C#/WPF] Calendar 클래스 사용하기 (0) | 2020.08.08 |
[C#/WPF] Frame 클래스 : Navigate 메소드를 사용해 페이지 이동하기 (0) | 2020.08.08 |
[C#/WPF] Button 엘리먼트 : Background 속성 사용하기 (0) | 2020.08.08 |
[C#/WPF] DrawingVisual 클래스 사용하기 (0) | 2020.08.07 |
[C#/WPF] UIElement 엘리먼트 : Clip 속성 사용하기 (0) | 2020.08.07 |
[C#/WPF] DrawingContext 클래스 : PushClip 메소드를 사용해 클리핑 영역 설정하기 (0) | 2020.08.06 |
[C#/WPF] Storyboard 클래스 : 이미지 슬라이드 쇼 보여주기 (0) | 2020.08.06 |
[C#/WPF] WriteableBitmap 클래스 : 비트맵 픽셀 조작하기 (0) | 2020.08.06 |
댓글을 달아 주세요