WPF Tutorial
Welcome to this free online Windows Presentation Foundation tutorial.
Wednesday, July 22, 2015
How to bind to a parent DataContext property in WPF
WPF
>
RelativeSource >
FindAncestor
Bind to a parent DataContext property example
IsEnabled
="{
Binding
RelativeSource
={
RelativeSource
FindAncestor
,
AncestorType
={
x
:
Type
Window
}},
Path
=DataContext.YourParentProperty}"
‹
›
Home
View web version