title: How to pass a static value to IValueConverter in XAML
body: <p>I would like to use static texts fetched from a web service in my WP7 app. Each text has a Name (the indetifier) and a Content property.</p>
  
  <p>For example a text could look like this:</p>
  
  <pre><code>Name = "M43";
  Content = "This is the text to be shown";
  </code></pre>
  
  <p>I would then like to pass the Name (i.e. the identifier) of the text to an <code>IValueConverter</code>, which would then look up the the Name and return the text.</p>
  
  <p>I figured the converter to look something like this:</p>
  
  <pre><code>public class StaticTextConverter : IValueConverter
  {
      public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
      {
          if (value != null)
          {
              return App.StaticTexts.Items.SingleOrDefault(t =&gt; t.Name.Equals(value)).Content;
          }
  
          return null;
      }
  }
  </code></pre>
  
  <p>Then in the XAML:</p>
  
  <pre><code>&lt;phone:PhoneApplicationPage.Resources&gt;
      &lt;Helpers:StaticTextConverter x:Name="StaticTextConverter" /&gt;
  &lt;/phone:PhoneApplicationPage.Resources&gt;
  
  ...
  
  &lt;TextBlock Text="{Binding 'M43', Converter={StaticResource StaticTextConverter}}"/&gt;
  </code></pre>
  
  <p>However, this does not seem to work and I am not sure that I pass in the value to the converter correctly.</p>
  
  <p>Does anyone have some suggestions?</p>