views:

194

answers:

1

Hi,

I am restyling the default tooltip by creating an Application level typed style resource which applies to every tooltips. In the tooltip ControlTemplate, I need to access (Binding to) a property value from the element which defines the actual tooltip. The defining element can be of any type. Binding RelativeSource FindAncestor works only for the specified AncestorType, not any other unspecified types. So my questions are, Can the AncestorType set to Any, or not applicable, but use AncestorLevel only? Is there other way for the controlTemplate to access the tooltip defining element's properties?

Any thought is appreciated.

Thanks,

Q

A: 

I find the following solution works.

{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Popup}, Path=PlacementTarget.TheDesiredPropertyNameHere}

Qstonr