Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Binding a trigger on a rectangle to dependency property of enclosing parent

Binding a trigger on a rectangle to dependency property of enclosing parent

Scheduled Pinned Locked Moved WPF
wpfdatabasewcfhelplearning
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chuck844
    wrote on last edited by
    #1

    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>
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups