title: WPF use an outside IValueConverter in UserControl
body: <p>I create a general-purpose UserControl which looks like a TickBar with labels shown below each tick. The UserControl is used to show timeline or map zoom scale and so on.</p>
  
  <p>The text shown in label is formatted according to the value (its type is double) of tick, which is calculated by Min, Max and TickFrequency of the UserControl, that means, the texts will not be bound to a ItemsSource (I know how to format texts outside UserControl, and then pass them into UserControl, but it not my case).</p>
  
  <p>Because the format of texts is determined by the user of the UserControl, for example, when UserControl is used as a timeline, show text like "00:00 01:00 02:00 ...", but when used as a map zoom scale, shown text like "1x 2x 4x 8x".</p>
  
  <p>My solution is to pass a IValueConverter into the UserControl through a Dependency Property. My first try is to write like this (LabelConverter is a Dependency Property of MyUserControl):</p>
  
  <p>MyUserControl.xaml</p>
  
  <pre><code>&lt;UserControl Name="usercontrol"&gt;
  ...
      &lt;TextBlock Text="{Binding Value, Converter={Binding LabelConverter, ElementName=usercontrol}}" /&gt;
  ...
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>MainWindow.xaml</p>
  
  <pre><code>&lt;uc:MyUserControl LabelConverter="{StaticResource TickToStringConverter}" /&gt;
  </code></pre>
  
  <p>But failed because Binding.Converter of TextBlock.Text is not a Dependency Property, we can't Binding it to a property. And we can't use Converter={StaticResource ...} because we can't define a converter resource in UserControl because it is determined by user.</p>
  
  <p>So, How to use this IValueConterter property in XAML? Or any other solution?</p>