title: How to add dynamically created hyperlink to stack panel programmatically wpf
body: <p>i am creating hyperlinks and want to add it to stack panel.</p>
  
  <pre><code>for (int i = 1; i &lt;= links.Length; i++)
  {
      Hyperlink hyperlink = new Hyperlink()
      {
          NavigateUri = new Uri(links[i - 1])
      };
  }
  hyperlink.RequestNavigate += new System.Windows.Navigation.RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
  mainControl.Children.Add(hyperlink);
  </code></pre>
  
  <p>it gives me error - </p>
  
  <blockquote>
    <p>cannot convert to system.windows.documents.hyperlink to system.windows.uielement. </p>
  </blockquote>
  
  <p>i understand the namespace error but didn't find resolution because in uielement i dint find hyperlink.</p>