Closed silverdragon727 closed 8 years ago
Hi @silverdragon727, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.
TTYL, MSBOT;
@silverdragon727, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.
Thanks, MSBOT;
This property should not be needed. The otherwise value is the value that is set on the element by default
@skendrot Well I forgot to give a reason...
Given XAML snippet below,
<CheckBox x:Name="CheckBox" />
<SymbolIcon x:Name="Icon" Symbol="Setting">
<Interactivity:Interaction.Behaviors>
<Interactions:DataTriggerBehavior Binding="{Binding IsChecked, ElementName=CheckBox}" Value="True">
<Interactions:InvokeCommandAction Command="{Binding VerifyCommand}" />
<Interactions:ChangePropertyAction PropertyName="Symbol">
<Interactions:ChangePropertyAction.Value>
<Symbol>Accept</Symbol>
</Interactions:ChangePropertyAction.Value>
</Interactions:ChangePropertyAction>
<Interactions:DataTriggerBehavior.Otherwise>
<Interactions:ChangePropertyAction PropertyName="Symbol">
<Interactions:ChangePropertyAction.Value>
<Symbol>Cancel</Symbol>
</Interactions:ChangePropertyAction.Value>
</Interactions:ChangePropertyAction>
</Interactions:DataTriggerBehavior.Otherwise>
</Interactions:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</SymbolIcon>
As you can see, an Otherwise property is a convenient way to do so.
This is already possible through the DataTriggerBehavior as such:
<SymbolIcon x:Name="Icon" Symbol="Setting">
<Interactivity:Interaction.Behaviors>
<Interactions:DataTriggerBehavior Binding="{Binding IsChecked, ElementName=CheckBox}" Value="True">
<Interactions:InvokeCommandAction Command="{Binding VerifyCommand}" />
<Interactions:ChangePropertyAction PropertyName="Symbol">
<Interactions:ChangePropertyAction.Value>
<Symbol>Accept</Symbol>
</Interactions:ChangePropertyAction.Value>
</Interactions:ChangePropertyAction>
</Interactions:DataTriggerBehavior>
<Interactions:DataTriggerBehavior Binding="{Binding IsChecked, ElementName=CheckBox}" Value="False">
<Interactions:ChangePropertyAction PropertyName="Symbol">
<Interactions:ChangePropertyAction.Value>
<Symbol>Cancel</Symbol>
</Interactions:ChangePropertyAction.Value>
</Interactions:ChangePropertyAction>
</Interactions:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</SymbolIcon>
The Otherwise property provides with a straight-forward method for adding actions to be executed when the condition is not satisfied.