title: Can you StringFormat the NavigateUri property for Hyperlinks during XAML property databinding?
body: <p>Is there an easy way to transform or format a string as part of WPF data binding?</p>
  
  <p>Suppose I want to create a WPF Hyperlink element based on a string tag.</p>
  
  <pre><code>&lt;Hyperlink NavigateUri="{Binding Tag}"&gt;
      &lt;Run Text="{Binding Tag}" /&gt;
  &lt;/Hyperlink&gt;
  </code></pre>
  
  <p>But I need to transform the Tag first for the NavigateUri property to make it a true hyperlink or PackUri. </p>
  
  <p>For instance, if my tag were "folksonomy" I'd want to create a string like: <code>http://www.example.com/tags/tagview?tag=folksonomy</code></p>
  
  <p>What's the best way to achieve this? Is there a string manipulation function in XAML? Do I have to write a converter? Do I have to build a whole separate ViewModel class just to do a little string formatting?</p>
  
  <p><strong>UPDATE:</strong> There appears to be something strange going on with the Hyperlink element. I can get the StringFormat syntax suggested in the answers to work for the Text property of an ordinary TextBlock, but not for the NavigateUri property of a Hyperlink. </p>
  
  <p>As one answer noted, this is likely due to the fact that the NavigateUri property officially takes a Uri, not a string. Apparently a custom converter or ViewModel property will be required.</p>