wpf 自定义控件 绑定数据源不生效的解决方案
https://blog.csdn.net/qq_40197926/article/details/125678007
不能为UserControl 设置 DataContext
而应该为 FrameworkElement设置DataContext
将Control1中的 this.DataContext = this; 改为
(this.Content as FrameworkElement).DataContext = this;
https://blog.csdn.net/qq_40197926/article/details/125678007
不能为UserControl 设置 DataContext
而应该为 FrameworkElement设置DataContext
将Control1中的 this.DataContext = this; 改为
(this.Content as FrameworkElement).DataContext = this;