RelativeSource works on (nested) sub-property, while ElementName does not
问题 The problem with the code below is: the binding to SomeClassProp.SubTextProp doesn't work (the source property is not being set to textbox content), while to TextProp it does. XAML: <Window x:Class="TestWPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Name="wMain" SizeToContent="WidthAndHeight"> <StackPanel> <TextBox Text="{Binding ElementName=wMain, Path=SomeClassProp.SubTextProp}"