title: things on the usage of the richtextbox in windows phone
body: <p>I'm using the richtextbox to show some Html content in windows phone 7.1.</p>
  
  <p>The html source-code is like:</p>
  
  <pre><code>Paragraph1&lt;/p&gt;
  &lt;img src="http://www.ifanr.com/wp-content/uploads/2011/11/DSC_332401.jpg" alt="" width="600" height="338" /&gt;&lt;/p&gt;
  Paragraph2。&lt;/p&gt;
  &lt;h3&gt;Title h3&lt;/h3&gt;
  Paragraph3。
  &lt;/p&gt;
  </code></pre>
  
  <p>Then I use the </p>
  
  <pre><code>"string[] sArray = Regex.Split(html, "&lt;/p&gt;", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);"
  </code></pre>
  
  <p>to split them into a Array. Finally, I use the code:</p>
  
  <pre><code>foreach (string array in sArray)
              {
                  Paragraph parag = new Paragraph();
                  Run run = new Run();
                  Bold bold = new Bold();
                  if (!Regex.IsMatch(array.ToString(), @"&lt;img\b[^&lt;&gt;]*?\bsrc\s*=\s*[""']?\s*(?&lt;imgUrl&gt;[^\s""'&lt;&gt;]*)[^&lt;&gt;]*?/?\s*&gt;"))
                  {
                      //h3
                      if (array.ToString().Contains("&lt;/h3&gt;"))
                      {
                          string hString = array.ToString();
                          hString = Regex.Replace(hString, "&lt;h3&gt;", "");
                          string[] hArray = Regex.Split(hString, "&lt;/h3&gt;", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
                          bold.Inlines.Add(hArray[0].ToString());
                          parag.Inlines.Add(bold);
                          run.Text = hArray[1].ToString();
                          parag.Inlines.Add(run);
                      }
                      else
                      {
                          if(array.ToString().Contains("&lt;blockquote&gt;"))
                          {
                              run.Text = Regex.Replace(array.ToString(), "&lt;blockquote&gt;", "blockquote:");
                              run.FontSize = 18;
                          }
                          else
                              run.Text = array.ToString();
                          parag.Inlines.Add(run);
                      }
                      rtb.Blocks.Add(parag);
                  }
                  else
                  {
                      //insert the image into richtextbox
                      Regex regImg = new Regex(@"http://[^\[^&gt;]*?(gif|jpg|png|jpeg|bmp|bmp)", RegexOptions.IgnoreCase);
                      MatchCollection matches = regImg.Matches(array.ToString());
                      string result = null;
                      foreach (Match match in matches)
                          result = match.Value;
  
                      Image image = new Image();
  
                      image.Stretch = Stretch.Uniform;
                      image.Source = new BitmapImage(new Uri(result, UriKind.RelativeOrAbsolute));
                      InlineUIContainer iuc = new InlineUIContainer();
                      iuc.Child = image;
                      parag.Inlines.Add(iuc);
                      rtb.Blocks.Add(parag);
                  }
  </code></pre>
  
  <p>to add some Paragraph or images into the richtextbox, everything goes well in the beginning, but when I Scroll down the richtextbox, the rest paragraph disappear. It confused me all day long, as I could't find out what's wrong with the richtextbox.
  Is it just a bug in Windows phone? Any thoughts?</p>
  
  <p><strong>ScreenShot1</strong>:</p>
  
  <p><img src="https://i.stack.imgur.com/Imtaf.png" alt="screenshot 1"></p>
  
  <p><strong>ScreenShot2</strong>:</p>
  
  <p><img src="https://i.stack.imgur.com/IDatx.png" alt="Screenshot 2"></p>
  
  <p>p.s:it doesn't matter whether the html source-code contains some non-english characters or not. This happens when the html source-code is in a large amount of words. These two ScreenShots just show the problem.</p>