title: Windowsphone textblock limitation
body: <p>I have implemented textblock in Listbox ItemTemplate/data template.  It is databound to "Data"  which is getting read from an xml file. Everything works fine but, the text is getting trimmed in textblocks and a there ia a blank space. I know the reason and it is due to limitations in textblock. Now i tried to use,  Scrollable TextBlock for WP7 from Alex Yakhnin's Blog but I am not able to understand how to implement this in my project? </p>
  
  <p><strong>C# CODE:</strong> </p>
  
  <pre><code>string XMLTagNameBody = "page";
  
  private void ParseHeaderBody() 
  {
      XDocument SunderGutkaXMLInstance = XDocument.Load(xmlFileToOpen);
  
      var XMLBody = from query in SunderGutkaXMLInstance.Descendants(XMLTagNameBody)
                    select new BodyContentClass
                    {
                         Data = (string)query.Element("data"),
                    };
      ListBoxDisplayContent.ItemsSource = XMLBody;
  }
  
  public class BodyContentClass
  {
      string book;
      string data;
  
      public string Book
      {
          get { return book; }
          set { book = value; }
      }
  
      public string Data
      {
           get { return data; }
           set { data = value; }
      }
  }
  </code></pre>
  
  <p><strong>XAML Code:</strong></p>
  
  <pre><code>&lt;ListBox Margin="0,25,0,32" 
           x:Name="ListBoxDisplayContent"
           FontSize="48"
           HorizontalAlignment="Center"&gt;
      &lt;ListBox.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;StackPanel x:Name="ListBoxDisplayContentStackPanel"
                          Margin="10"
                          HorizontalAlignment="Center"&gt;
                  &lt;TextBlock x:Name="MainContentDisplayTextBlock"
                             TextWrapping="Wrap"
                             Text="{Binding Data}"
                             TextAlignment="Center"
                             HorizontalAlignment="Center" /&gt;
                  &lt;Image x:Name="dividerImage"
                         Stretch="Fill"
                         Source="/Assets/MainContentDivider.png"
                         Opacity="1"&gt;&lt;/Image&gt;
              &lt;/StackPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p><strong>Links for Alex Yakhnin's Blog/Scrollable TextBlock for WP7:</strong></p>
  
  <ul>
  <li><a href="http://social.msdn.microsoft.com/Forums/windowsapps/en-US/3af9bc99-2526-49fc-b4a5-4170e12d11ab/do-textblocks-have-a-max-line-limit-if-so-how-do-i-increase-it?forum=wpdevelop" rel="nofollow">http://social.msdn.microsoft.com/Forums/windowsapps/en-US/3af9bc99-2526-49fc-b4a5-4170e12d11ab/do-textblocks-have-a-max-line-limit-if-so-how-do-i-increase-it?forum=wpdevelop</a></li>
  <li><a href="http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx" rel="nofollow">http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx</a></li>
  </ul>