首先推一篇系列博客:https://www.cnblogs.com/chillsrc/p/4464023.html 【这是一篇通俗易懂的系列博客,对初学者大有裨益】
其次推荐一个PDF,深入浅出WPF完整版,地址:https://download.csdn.net/download/wolongbb/12582366 【PDF内容偏向于基础,可以借鉴,但不建议死磕】
1、WPF的XAML文件实际是一个树形框架结构文件。详见:https://www.cnblogs.com/lufangtao/archive/2012/09/11/2680486.html
2、既然是树形框架结构文件,我们就需要使用帮助类查询他的相关结构。可使用:VisualTreeHelper 及 LogicalTreeHelper 两个帮助类进行查询。
参考博客:https://www.cnblogs.com/xfuture/archive/2014/06/24/3806652.html
3、图形标签: <Rectangle x:Name="rect" Height="100" Width="100" Fill="Blue"></Rectangle>
给图形标签填充颜色:
SolidColorBrush brus = new SolidColorBrush(); brus.Color = Colors.Red; rect.Fill = brus;
4、WPF控件中的Binding有一种自动机制,就是当后台绑定的属性值发生改变时,会自动通知给UI元素。参考博客:https://www.cnblogs.com/Zhouyongh/archive/2009/09/10/1564099.html 或 https://www.cnblogs.com/dotnet261010/p/6286475.html