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

■ TextBlock 클래스 : TextWrapping 속성 사용하기

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


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">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

        <TextBlock

            Margin="10"

            FontSize="24"

            TextWrapping="Wrap">

For a long time I used to go to bed early. Sometimes, when I had put out

my candle, my eyes would close so quickly that I had not even time to

say "I'm going to sleep." And half an hour later the thought that it was

time to go to sleep would awaken me; I would try to put away the book

which, I imagined, was still in my hands, and to blow out the light; I

had been thinking all the time, while I was asleep, of what I had just

been reading, but my thoughts had run into a channel of their own,

until I myself seemed actually to have become the subject of my book:

a church, a quartet, the rivalry between François I and Charles V. This

impression would persist for some moments after I was awake; it did not

disturb my mind, but it lay like scales upon my eyes and prevented them

from registering the fact that the candle was no longer burning. Then

it would begin to seem unintelligible, as the thoughts of a former

existence must be to a reincarnate spirit; the subject of my book would

separate itself from me, leaving me free to choose whether I would form

part of it or no; and at the same time my sight would return and I

would be astonished to find myself in a state of darkness, pleasant and

restful enough for the eyes, and even more, perhaps, for my mind, to

which it appeared incomprehensible, without a cause, a matter dark

indeed.

        </TextBlock>

    </Grid>

</Page>

 

 

MainPage.xaml.cs

 

 

using Windows.UI.Xaml.Controls;

 

namespace TestProject

{

    /// <summary>

    /// 메인 페이지

    /// </summary>

    public sealed partial class MainPage : Page

    {

        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor

        ////////////////////////////////////////////////////////////////////////////////////////// Public

 

        #region 생성자 - MainPage()

 

        /// <summary>

        /// 생성자

        /// </summary>

        public MainPage()

        {

            InitializeComponent();

        }

 

        #endregion

    }

}

 

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요