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="..." />...
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?
...
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...