Reputation: 101
I have a trigger in WPF, i want to use the same kind in Silverlight version, can any one please help me to write the below sample WPF trigger into Silverlight?
<ControlTemplate.Triggers>
<Trigger Property="pop:Indicator.HaveResults" Value="True">
<Setter Property="Visibility" TargetName="PART_Symbol" Value="Visible"/>
<Setter Property="Opacity" TargetName="EditIndicator" Value="0" />
</Trigger>
</ControlTemplate.Triggers>
Thank you in advance.
Upvotes: 0
Views: 170
Reputation: 447
I'm not sure that specifically in this case a simple binding won't do the job better, but, I suspect he following should work:
Add references to the assemblies in the following namespaces (and the namespace)
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
and then
<i:Interaction.Triggers>
<ei:DataTrigger Binding="{Binding Indicator.HaveResults}" Value="True">
<ei:DataTrigger.Actions>
<ei:ChangePropertyAction TargetName="X" PropertyName="Y" Value="Z"/>
</ei:DataTrigger.Actions>
</ei:DataTrigger>
</i:Interaction.Triggers>
Upvotes: 2