Binding to a Control Template
<p>I need to bind a button to a Control Template. The XAML looks something like this:</p>

<pre><code>Button Template="{Binding Status, Converter={StaticResource StatustoTemplate}}"
</code></pre>

<p>The converter (<strong>StatustoTemplate</strong>) runs fine as the status (which is an integer, but happy for it to be a string) changes:</p>

<pre><code>public class StatustoTemplate : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)

        {
           if (value==1)
           {
               return ControlTemplateName1;
           }
           if (value==2)
           {
               return ControlTemplateName2;
           }
        }
}
</code></pre>

<p>Now, in what format can I send back <strong>ControlTemplate1</strong>, or <strong>ControlTemplate2</strong>? Let us assume that <strong>ControlTemplate1</strong> and <strong>ControlTemplate2</strong> are valid Control Templates as defined in the XAML. I now that it needs to return a ControlTemplate - but how to set it up?</p>