첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

728x90
반응형

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="Style 엘리먼트 : TargetType 속성을 사용해 문단 스타일 설정하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Window.Resources>
        <Style x:Key="ParagraphKey" TargetType="{x:Type Paragraph}">
            <Setter Property="TextIndent" Value="0.25in" />
        </Style>
        <Style x:Key="HeaderParagraphKey" TargetType="{x:Type Paragraph}">
            <Setter Property="TextAlignment" Value="Center" />
            <Setter Property="FontSize"      Value="16pt"   />
        </Style>
    </Window.Resources>
    <FlowDocumentReader>
        <FlowDocument>
            <Paragraph Style="{StaticResource HeaderParagraphKey}">
                Chapter I
            </Paragraph>
            <Paragraph Style="{StaticResource HeaderParagraphKey}">
                Down the Rabbit-Hole
            </Paragraph>
            <Paragraph Style="{StaticResource ParagraphKey}">
                Alice was beginning to get very tired of sitting by
                her sister on the bank, and of having nothing to do:
                once or twice she had peeped into the book her sister
                was reading, but it had no pictures or conversations
                in it, “and what is the use of a book,”
                thought Alice, “without pictures or
                conversations?”
            </Paragraph>
            <Paragraph Style="{StaticResource ParagraphKey}">
                ...
            </Paragraph>
        </FlowDocument>
    </FlowDocumentReader>
</Window>
728x90
반응형
Posted by 사용자 icodebroker
TAG , ,

댓글을 달아 주세요