Search This Blog

Showing posts with label DataContext. Show all posts
Showing posts with label DataContext. Show all posts

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}"