I have the following dependency property:
public bool IterationSelected
{
get { return (bool)GetValue(IterationSelectedProperty); }
set { SetValue(IterationSelectedProperty, value); }
}
public static readonly DependencyProperty IterationSelectedProperty =
DependencyProperty.Register("IterationSelected", typeof(bool),
typeof(MainMediator), new UIPropertyMetadata(false));
(this was generated from the VS template)
I then have this trigger that updates it:
<Grid.Style>
<Style>
<Style.Triggers>
<DataTrigger Value="True">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource IsOpenFalseAndIsCheckedTrueMultiConverter}">
<Binding ElementName="popSelectIteration" Path="IsOpen"/>
<Binding ElementName="chkIteration" Path="IsChecked"/>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="loc:MainMediator.IterationSelected" Value="True"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
Lastly, I have this Grid that has its visibility dependent on the property.
<Grid Visibility="{Binding IterationSelected, Converter={StaticResource BooleanToVisibilityConverter}, diagnostics:PresentationTraceSources.TraceLevel=High}" Grid.Row="1">
<TextBlock>Testing 1323</TextBlock>
</Grid>
So, here is the problem, I have used: diagnostics:PresentationTraceSources.TraceLevel="High"
to test all the bindings and everything works fine except that when loc:MainMediator:IterationSelected gets set to true, the Grid does not pickup on it. Nothing fires at all. It is not that it can't bind or anything like that. It just does not even try. The only time the grid binding fires is at start of the app. It fires and evaluates correctly at that time.
The only thing I have tried (and failed at) was making IterationSelected
an attached property instead of a plain dependency property. However, that failed too.
WPF Gurus, any ideas?