Using Nested Span elements to change the style of text in a TextBlock : Span « Windows Presentation Foundation « C# / CSharp Tutorial






<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      HorizontalAlignment="Center" VerticalAlignment="Center">


<TextBlock>
  <Span FontFamily="Cambria">
    This uses <Span FontWeight="Bold">a
    <Span FontStyle="Italic">mixture</Span> of</Span> styles.
  </Span>
</TextBlock>


</Page>
WPF Nested Span Elements








24.12.Span
24.12.1.Using Nested Span elements to change the style of text in a TextBlockUsing Nested Span elements to change the style of text in a TextBlock