title: WPF - cannot parse TextBlock element from string
body: <p>I'm new in WPF</p>
  <p>I need to get string param, create an UIElement and attach it to the view.
  Parsing the element from the string is failed, I don't know why.</p>
  <p>Here is the code:</p>
  <pre><code>public void addElementToView(string str)
  {
        object obj = XamlReader.Load(new XmlTextReader(new StringReader(str)));
        UIElement elem = (UIElement)obj;
        SpecialContent.Children.Add(elem);
  }
  </code></pre>
  <p>call <code>addElementToView(&quot;&lt;TextBox Text=\&quot;hello\&quot;/&gt;&quot;)</code> fails with the following exception:</p>
  <blockquote>
  <p>A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll</p>
  <p>Additional information: 'Cannot create unknown type 'TextBlock'.' Line number '1' and line position '2'.</p>
  </blockquote>
  <p>It failes in this row:</p>
  <pre><code>object obj = XamlReader.Load(new XmlTextReader(new StringReader(str)));
  </code></pre>
  <p>Any idea?</p>