title: TextBlock scroll is not working in WPF
body: <p>I want to make my <code>TextBlock</code> scrollable but I can't make it work. Maybe problem is in <code>StackPanel</code>?</p>
  
  <p>So here is the code:</p>
  
  <pre><code> &lt;Grid Margin="3"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="152*" /&gt;
              &lt;RowDefinition Height="86*" /&gt;
              &lt;RowDefinition Height="67*" /&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;ListBox x:Name="lstItems" Margin="3,6,3,0" ItemsSource="{Binding Source={StaticResource rssData}}"
                   SelectedIndex="0"&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}" Grid.RowSpan="2"&gt;
              &lt;StackPanel.ScrollOwner&gt;
                  &lt;ScrollViewer /&gt;
              &lt;/StackPanel.ScrollOwner&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;ScrollViewer&gt;
                  &lt;TextBlock ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="3" FontStyle="Italic" Text="{Binding XPath=description, Path=InnerText}" TextWrapping="Wrap" TextAlignment="Justify" Height="216" Width="489" AllowDrop="False" Foreground="#FF0000E7" FontFamily="Lucida Sans Unicode" /&gt;
              &lt;/ScrollViewer&gt;
          &lt;/StackPanel&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>Problem is in this part:</p>
  
  <pre><code>&lt;ScrollViewer&gt;
               &lt;TextBlock ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="3" FontStyle="Italic" Text="{Binding XPath=description, Path=InnerText}" TextWrapping="Wrap" TextAlignment="Justify" Height="216" Width="489" AllowDrop="False" Foreground="#FF0000E7" FontFamily="Lucida Sans Unicode" /&gt;
  &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p>This part of the code should be able to scroll. I can see vertical scroll bar but can't scroll. I want to be able to see in <code>StackPanel</code> as I am not allowing any changes and want read only.</p>
  
  <p>Thank you</p>
  
  <p>EDIT:</p>
  
  <pre><code>&lt;Window x:Class="RssDemo.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="RSS Demo" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="576" Width="521"&gt;
      &lt;Window.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;/Window.Background&gt;
  
      &lt;Window.Resources&gt;
          &lt;XmlDataProvider x:Key="rssData" XPath="//item" Source="http://www.hak.hr/rss/stanje/hr.xml" /&gt;
      &lt;/Window.Resources&gt;
  
      &lt;Grid Margin="3"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="*" /&gt;
              &lt;RowDefinition Height="*" /&gt;
              &lt;RowDefinition Height="*" /&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;ListBox x:Name="lstItems" Margin="3,6,3,0" ItemsSource="{Binding Source={StaticResource rssData}}"
                   SelectedIndex="0"&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}"&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"&gt;
              &lt;TextBlock ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="3"
                         FontStyle="Italic" Text="{Binding XPath=description, Path=InnerText}" TextWrapping="Wrap" TextAlignment="Justify" Width="489" AllowDrop="False"
                         Foreground="#FF0000E7" FontFamily="Lucida Sans Unicode" /&gt;
          &lt;/ScrollViewer&gt;
  
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Paste this code to your project as this is with the rss link where I read info. Just to see what you will get</p>