方法一:通过 ElementName 绑定外层控件的 DataContext。
{Binding DataContext.×××, ElementName=×××}方法二:通过 RelativeSource 绑定外层控件的 DataContext。
{Binding DataContext.×××, RelativeSource={RelativeSource AncestorType=×××}}方法三(推荐):将 ViewModel 作为资源并用 Source 指定。
<×××.Resources>
<×××ViewModel x:Key="×××ViewModel"/>
</×××.Resources>{Binding ×××, Source={StaticResource ×××ViewModel}}
https://learn.microsoft.com/zh-cn/dotnet/desktop/wpf/data/how-to-specify-the-binding-source
https://www.cnblogs.com/yzw123/p/15599092.html
https://blog.csdn.net/weixin_44246065/article/details/104723561