Should triggers / DataTrigger return to the previous state if this is no longer true in WPF?

When reading a DataTrigger on MSDN it says:

Represents a trigger that applies property values ​​or performs an action when the associated data meets a specified condition.

It means

When the trigger is correct, it changes the value to the desired value.

But can this be done?

When it is no longer true, it returns the value to the previous value.


How did I come to this conclusion

I did it

<Style x:Key="fd" TargetType="SomeControl">
 <Setter Property="Control.Template">
  <Setter.Value>
   <ControlTemplate>
    <Button Content="Foo" x:Name="mybutton">
    <ControlTemplate.Triggers>
     <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=FooProperty}" 
                  Value="Collapsed">
      <Setter Property="IsEnabled" Value="False" TargetName="mybutton"/>
      <Setter Property="Opacity" Value="0.5" TargetName="mybutton"/>
     </DataTrigger>
    </ControlTemplate.Triggers>
   </ControlTemplate>
  </Setter.Value>
 </Setter>
</Style>

When reset, FooPropertyit changes mybutton IsEnabledto Falseand Opacityto0.5

, FooProperty , mybutton IsEnabled True Opacity 1, .

DataTrigger . ?

, - Microsoft/MSDN, ?

+5
1

, , .

, , :

http://msdn.microsoft.com/en-us/library/ms745683.aspx

http://msdn.microsoft.com/en-us/library/system.windows.trigger.aspx

" "

WPF , , IsMouseOver, true, UIElement IsMouseOver ContentElement. , Trigger, WPF , .

, , reset , . , , , , , IsPressed on Button IsSelected ListBoxItem. , , .

, . , .

:)

+4

All Articles