Binding a trigger on a rectangle to dependency property of enclosing parent
WPF
1
Posts
1
Posters
1
Views
1
Watching
-
I have used CodeProject as a resource for a long time but now I have an issue I haven't been able to work through ... I have a user control "uc_SignalHead_cl" that is derived from "uc_TrackDisplayItem_cl" which is derived from "UserControl". In uc_SignalHead_cl is a rectangle that I want to change the fill color based on the "SignalDispatchState" dependency property that is defined on "uc_SignalHead_cl". I do not get any runtime binding errors but the fill color is not changing. I know that the dependency property is changing because a "property changed" even is being executed. XAML (some code deleted for clarity):
<---deleted code---> <Setter Property="StrokeThickness" Value="1"/> <Setter Property="Opacity" Value="0.5"/> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="StrokeThickness" Value="9"/> <Setter Property="Opacity" Value="1.0"/> </Trigger> <DataTrigger Binding="{Binding SignalDispatchState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Value="DS\_Normal"> <Setter Property="Fill" Value="Blue"/> </DataTrigger> <DataTrigger Binding="{Binding SignalDispatchState, Re</x-turndown>