DataTrigger sets default value when condition is false

So here is my XAML:

<Ellipse Height="100" Width="100" Margin="35,112,0,0" Name="ellipse1" Fill="Red"> <Ellipse.Style> <Style TargetType="Ellipse"> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=checkBox1, Path=IsChecked}" Value="true"> <Setter Property="Ellipse.Visibility" Value="Collapsed"></Setter> </DataTrigger> </Style.Triggers> </Style> </Ellipse.Style> </Ellipse> <CheckBox Content="CheckBox" Height="16" Margin="42,79,168,166" Name="checkBox1" /> 

When the checkbox is checked, of course, the ellipse disappears, but when it is disabled, it appears again, but I don’t know why. This is normal? Why is this happening?

+7
source share
1 answer

The trigger restores the original value of the property.

About trigger and value

+5
source

All Articles