I have the following DataTemplate for my Tool Bar Items:
<DataTemplate DataType="{x:Type viewModels:PopupContextActionViewModel}">
<Grid>
<ToggleButton Name="ToggleButton">
<ContentControl Template="{Binding Icon, Converter={StaticResource NameToResourceConverter}}" Margin="5" />
</ToggleButton>
<Popup Name="ContextActionPopup" StaysOpen="False" AllowsTransparency="True"
IsOpen="{Binding
ElementName=ToggleButton,
Path=IsChecked,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}">
<Border Background="Transparent" Name="Border" Visibility="Visible">
<ContentControl x:Name="ContentControl" userInterface:RegionHelper.RegionName="{Binding RegionId}" Style="{StaticResource PopupContentStyle}" />
</Border>
</Popup>
</Grid>
<DataTemplate.Triggers>
<Trigger SourceName="ContentControl" Property="Content" Value="{x:Null}">
<Setter TargetName="ContextActionPopup" Property="IsOpen" Value="False" />
</Trigger>
</DataTemplate.Triggers>
Everything works fine (my popup and my toggle button do work together as they should) But if I set the value of the Trigger of my DataTemplate (which is done by my business logic, or more specific by some "NavigationService") the Popup gets closed while the ToggleButton stays checked.
Why does my Trigger not change the IsChecked Property of my ToggleButton as well?