다음을 통해 공유


RichTextBlockOverflow.IsTextTrimmedChanged 이벤트

정의

IsTextTrimmed 속성 값이 변경될 때 발생합니다.

// Register
event_token IsTextTrimmedChanged(TypedEventHandler<RichTextBlockOverflow, IsTextTrimmedChangedEventArgs const&> const& handler) const;

// Revoke with event_token
void IsTextTrimmedChanged(event_token const* cookie) const;

// Revoke with event_revoker
RichTextBlockOverflow::IsTextTrimmedChanged_revoker IsTextTrimmedChanged(auto_revoke_t, TypedEventHandler<RichTextBlockOverflow, IsTextTrimmedChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<RichTextBlockOverflow,IsTextTrimmedChangedEventArgs> IsTextTrimmedChanged;
function onIsTextTrimmedChanged(eventArgs) { /* Your code */ }
richTextBlockOverflow.addEventListener("istexttrimmedchanged", onIsTextTrimmedChanged);
richTextBlockOverflow.removeEventListener("istexttrimmedchanged", onIsTextTrimmedChanged);
- or -
richTextBlockOverflow.onistexttrimmedchanged = onIsTextTrimmedChanged;
Public Custom Event IsTextTrimmedChanged As TypedEventHandler(Of RichTextBlockOverflow, IsTextTrimmedChangedEventArgs) 
<RichTextBlockOverflow IsTextTrimmedChanged="eventhandler"/>

이벤트 유형

Windows 요구 사항

디바이스 패밀리
Windows 10 Fall Creators Update (10.0.16299.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v5.0에서 도입되었습니다.)

예제

이 예제에서는 RichTextBlock 및 두 개의 RichTextBlockOverflow 컨트롤 을 사용하여 세 개의 열 레이아웃을 생성합니다. RichTextBlockTextTrimming 속성을 CharacterEllipsis로 설정하고 첫 번째 RichTextBlockOverflow에 바인딩한 다음 두 번째 RichTextBlockOverflow에 바인딩합니다.

창 크기를 조정하면 열의 크기가 조정되어 IsTextTrimmedChanged 이벤트가 트리거됩니다.

<StackPanel>
    <Grid x:Name="ColumnGrid" Height="200">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <RichTextBlock Grid.Column="0" Margin="12,0" 
                        OverflowContentTarget="{x:Bind firstOverflowContainer}"
                        TextAlignment="Justify" TextTrimming="CharacterEllipsis"                         
                        IsTextTrimmedChanged="RichTextBlock_IsTextTrimmedChanged">
            <Paragraph>
                Linked text containers allow text which does not fit in one element 
                to overflow into a different element on the page. Creative use of 
                linked text containers enables basic multicolumn support and other 
                advanced page layouts.
            </Paragraph>
            <Paragraph>
                Duis sed nulla metus, id hendrerit velit. Curabitur dolor purus, 
                bibendum eu cursus lacinia, interdum vel augue. Aenean euismod 
                eros et sapien vehicula dictum. Duis ullamcorper, turpis nec 
                feugiat tincidunt, dui erat luctus risus, aliquam accumsan 
                lacus est vel quam. Nunc lacus massa, varius eget accumsan id, 
                congue sed orci. Duis dignissim hendrerit egestas. Proin ut 
                turpis magna, sit amet porta erat. Nunc semper metus nec magna 
                imperdiet nec vestibulum dui fringilla. Sed sed ante libero, 
                nec porttitor mi. Ut luctus, neque vitae placerat egestas, 
                urna leo auctor magna, sit amet ultricies ipsum felis quis 
                sapien. Proin eleifend varius dui, at vestibulum nunc 
                consectetur nec. Mauris nulla elit, ultrices a sodales non, 
                aliquam ac est. Quisque sit amet risus nulla. Quisque 
                vestibulum posuere velit, vitae vestibulum eros scelerisque 
                sit amet. In in risus est, at laoreet dolor. Nullam aliquet 
                pellentesque convallis. Ut vel tincidunt nulla. Mauris auctor 
                tincidunt auctor.
                Aenean orci ante, vulputate ac sagittis sit amet, consequat at mi. 
                Morbi elementum purus consectetur nisi adipiscing vitae blandit 
                sapien placerat. Aliquam adipiscing tortor non sem lobortis 
                consectetur mattis felis rhoncus. Nunc eu nunc rhoncus arcu 
                sollicitudin ultrices. In vulputate eros in mauris aliquam id 
                dignissim nisl laoreet.
            </Paragraph>
        </RichTextBlock>
        <RichTextBlockOverflow x:Name="firstOverflowContainer" Grid.Column="1"  Margin="12,0"
                                IsTextTrimmedChanged="OverflowContainer_IsTextTrimmedChanged"
                                OverflowContentTarget="{x:Bind secondOverflowContainer}" />
        <RichTextBlockOverflow x:Name="secondOverflowContainer" Grid.Column="2" Margin="12,0" 
                                IsTextTrimmedChanged="OverflowContainer_IsTextTrimmedChanged"/>
    </Grid>
</StackPanel>
namespace TextTrimming1
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        private void RichTextBlock_IsTextTrimmedChanged(RichTextBlock sender, IsTextTrimmedChangedEventArgs args)
        {
            if (sender.IsTextTrimmed)
            {
                //do something
            }
        }

        private void OverflowContainer_IsTextTrimmedChanged(RichTextBlockOverflow sender, IsTextTrimmedChangedEventArgs args)
        {
            if (sender.IsTextTrimmed)
            {
                ColumnGrid.Height += 100;
            }
        }
    }
}

설명

RichTextBlockTextBlock/의 TextTrimming 속성이 없음(기본값)으로 설정된 경우 트리밍 표시기가 그려지지 않고 IsTextTrimmedChanged 이벤트가 발생하지 않습니다.

적용 대상