title: How to make TextBlock scrollable inWPF
body: <p>I want to have my textblock area scrollable as there is a lot text to load.</p>
  
  <p>I will put al of the code as it is not too big so you can test it.</p>
  
  <pre><code>&lt;UserControl x:Class="Fleet_management.Info"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               mc:Ignorable="d" Height="492" Width="578"&gt;
      &lt;UserControl.Background&gt;
          &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
              &lt;GradientStop Color="#FFE2E2E2" Offset="0" /&gt;
              &lt;GradientStop Color="White" Offset="1" /&gt;
          &lt;/LinearGradientBrush&gt;
      &lt;/UserControl.Background&gt;
  
      &lt;UserControl.Resources&gt;
          &lt;XmlDataProvider x:Key="rssData" XPath="//item" Source="*******" /&gt;
      &lt;/UserControl.Resources&gt;
  
      &lt;Grid Margin="3" Height="598" Width="565"&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="252*" /&gt;
              &lt;ColumnDefinition Width="90*" /&gt;
              &lt;ColumnDefinition Width="223*" /&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="177*" /&gt;
              &lt;RowDefinition Height="55*" /&gt;
              &lt;RowDefinition Height="122*" /&gt;
              &lt;RowDefinition Height="177*" /&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;ListBox x:Name="lstItems" Margin="3,0" ItemsSource="{Binding Source={StaticResource rssData}}"
                   SelectedIndex="0" VerticalAlignment="Stretch" FontStretch="Normal" FontSize="14" FontFamily="Lucida Sans Unicode" Grid.ColumnSpan="3"&gt;
              &lt;ListBox.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;StackPanel Orientation="Horizontal"&gt;
                          &lt;Image Width="20" Margin="3" Source="{Binding XPath=enclosure/@url}" /&gt;
                          &lt;TextBlock Margin="3" VerticalAlignment="Center" Text="{Binding XPath=title}" FontWeight="Bold" /&gt;
                      &lt;/StackPanel&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
          &lt;/ListBox&gt;
  
          &lt;StackPanel Grid.Row="1" Orientation="Vertical" DataContext="{Binding ElementName=lstItems, Path=SelectedItem}" Margin="0,0,0,5" Grid.ColumnSpan="3"&gt;
              &lt;TextBlock Margin="3" FontSize="13" FontWeight="Bold" Text="{Binding XPath=title, Path=InnerText}" /&gt;
              &lt;TextBlock Margin="3" Opacity="0.72" Text="{Binding XPath=pubDate}" /&gt;
          &lt;/StackPanel&gt;
          &lt;ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" DataContext="{Binding ElementName=lstItems, Path=SelectedItem}" Margin="0,0,3,115" Grid.RowSpan="2" Grid.ColumnSpan="3"&gt;
              &lt;TextBlock ScrollViewer.CanContentScroll="True" Margin="3"
                         FontStyle="Italic" Text="{Binding XPath=description, Path=InnerText}" TextWrapping="Wrap" TextAlignment="Justify" Width="528" AllowDrop="False"
                         Foreground="#FF0000E7" FontFamily="Lucida Sans Unicode" Height="215" FontSize="14" Padding="0,0,5,0" /&gt;
          &lt;/ScrollViewer&gt;
  
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>This is the part that is not working correctly:</p>
  
  <pre><code>&lt;ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" DataContext="{Binding ElementName=lstItems, Path=SelectedItem}" Margin="0,0,3,115" Grid.RowSpan="2" Grid.ColumnSpan="3"&gt;
              &lt;TextBlock ScrollViewer.CanContentScroll="True" Margin="3"
                         FontStyle="Italic" Text="{Binding XPath=description, Path=InnerText}" TextWrapping="Wrap" TextAlignment="Justify" Width="528" AllowDrop="False"
                         Foreground="#FF0000E7" FontFamily="Lucida Sans Unicode" Height="215" FontSize="14" Padding="0,0,5,0" /&gt;
          &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p>Code is loading text but not all of it, there should be scroll</p>