TextBlock

 

TextBlock Examples

 

Example 1:

<TextBlock Text="This is an example">

Example 2:

<TextBlock>This is another example</TextBlock>

Example 3:

<TextBlock Margin="10" TextWrapping="Wrap" HorizontalAlignment="Right">
    This <Span FontWeight="Bold">is</Span> a
    <Span Background="Silver" Foreground="Maroon">TextBlock</Span>
    with <Span TextDecorations="Underline">several</Span>
    <Span FontStyle="Italic">Span</Span> elements,
    <Span Foreground="Blue">
            using a <Bold>variety</Bold> of <Italic>styles</Italic>
    </Span>.
</TextBlock>

Example 4:

<TextBlock TextWrapping="Wrap"><Span FontSize="20">This <Run>is</Run> a <Bold>test</Bold><LineBreak/>And <Hyperlink NavigateUri="http://www.cshtml5.com">here is a link</Hyperlink>. TextBlock with <Bold>bold</Bold>, <Italic>italic</Italic> and <Underline>underlined</Underline> text.<LineBreak/>This is a new line.</Span></TextBlock>

 

Contact Us

Please click here for contact information.