WPF设置Window的数据上下文(DataContext)为自身

WPF设置Window的数据上下文(DataContext)为自身的XAML:

DataContext="{Binding RelativeSource={RelativeSource Self}}"
原文地址:https://www.cnblogs.com/527289276qq/p/6509381.html