Search This Blog

Wednesday, July 22, 2015

How to bind to a parent DataContext property in WPF

WPFRelativeSource > FindAncestor

Bind to a parent DataContext property example



IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.YourParentProperty}"