findancestor

What exactly does WPF Data Binding's "RelativeSource FindAncestor" do?

I am currently working within a WPF user control (the root element of my XAML file is "UserControl"), which I know is being hosted inside a Window. How can I access a property of the Window using data binding? Does anyone know why simply <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type Window}}" Path="..." />...

Expander.IsExpaned only if current template is a descendant of a ToolTip.

Hello. I am using a DataTemplate (a StaticResource) in several places in my application as in an ItemsControl, ContentControl and in a ToolTip. The template contains an Expander, and I want its IsExpanded property to be true if the DataTemplate is located within a ToolTip. Any recommendations? ...

FindAncestor does not work for UserControl in ListView.ItemTemplate

Hi Everyone, I'm having some issues when trying to bind a property of a UserControl in a ItemTemplate with a FindAncestor mode. I have the following code: <Window x:Class="TestUserControlBinding.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/200...