Q:

Set or change Converter using a trigger?

Here is my TextBox with a converter:
 <TextBox Text="{Binding TimbraturaSelezionata.OrarioMinuti, Converter={StaticResource Minuti2HHmmConverter}}" Margin="5,0"/>

I searched for a way to set or change the converter only when it is effectively needed.
In fact I would like to put that TextBox inside a general purpose User Control and apply the converter only when a specific condition is met.
The only solution that came to my mind is to use a ContentControl and use two DataTrigger to set its template, one with the Converter inside the TextBox, and one without. I would hope finding a clearer way to achieve my goal.
Thanks for any suggestions.  

A:

Since you're set on a trigger. Here's an example. Hope it helps;
<TextBox x:Name="MyTextBox" Text="{Binding TimbraturaSelezionata.OrarioMinuti}" Margin="5,0">
    <i:Interaction.Triggers>
      <ei:DataTrigger Value="False"
                      Binding="{Binding YourCondition, ElementName=MyTextBox}">
          <ei:ChangePropertyAction PropertyName="Text"
                                   Value="{Binding TimbraturaSelezionata.OrarioMinuti}" />
      </ei:DataTrigger>
      <ei:DataTrigger Value="True"
                      Binding="{Binding YourCondition, ElementName=MyTextBox}">
          <ei:ChangePropertyAction PropertyName="Text"
                                   Value="{Binding TimbraturaSelezionata.OrarioMinuti, Converter={StaticResource Minuti2HHmmConverter}}" />
       </ei:DataTrigger>
    </i:Interaction.Triggers>
</TextBox>

