1.System.Windows.Data.Binding.Binding(string path)
解析:使用初始路径初始化Binding类的新实例。
2.RoutedEventHandler System.Windows.FrameworkElement.Loaded
解析:当对元素进行布局、呈现,且可将其用于交互时发生。
3.System.Windows.Controls.Primitives.Selector.SelectedItem
解析:获取或设置当前所选内容中的第一项或如果所选内容为空则返回null。
4.SolidColorBrush System.Windows.Media.Brushes.AliceBlue
解析:获取具有十六进制值#FFF0F8FF的纯色填充颜色。
5.System.Windows.Controls.Expander.ExpandDirection
解析:获取或设置在其中的方向Expander内容窗口随即打开。
6.System.Windows.GridUnitType
解析:描述GridLength对象包含的值的种类。
7.System.Windows.Controls.ItemsControl.ItemsSource
解析:获取或设置用于生成ItemsControl的内容的集合。
8.System.Windows.Input.MouseButtonEventArgs
解析:为鼠标按钮相关事件提供数据。
9.System.ICloneable
解析:支持克隆,即用与现有实例相同的值创建类的新实例。
10.int Dapper.SqlMapper.Execute(this IDbConnection cnn, string sql, object param = null, IDbTransaction transaction = null, int? commandTimeout = null, CommandType? commandType = null)
解析:Execute parameterized SQL.
11.System.Windows.Media.LinearGradientBrush
解析:使用线性渐变绘制区域。
12.System.Windows.Controls.TextBlock.Foreground
解析:获取或设置要应用到TextBlock的文本内容的Brush。
13.控件模板和数据模板
解析:控件模板主要是用来改变控件的外观,数据模板则定义控件中数据的表现方式。
14.控件模板ControlTemplate
解析:
[1]VistualTree视觉树,即是能看到的外观
[2]Trigger触发器,里面包括外部条件达到某一条件下会引起的响应
15.定义按钮控件模板
解析:
<Window.Resources >
<ControlTemplate x:Key="buttonTemplate" TargetType="Button" >
<Grid >
<Ellipse Name="faceEllipse" Height="50" Width="100" Fill="{TemplateBinding Button.Background}"/>
<TextBlock Name="txtBlock" />
</Grid >
<ControlTemplate.Triggers >
<Trigger Property="Button.IsMouseOver" Value="True">
<Setter Property="Button.Background" Value="blue"/>
</Trigger >
</ControlTemplate.Triggers >
</ControlTemplate >
</Window.Resources >
使用按钮控件模板代码:
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="216,224,0,0" Name="button3" Width="75" Template="{StaticResource buttonTemplate}"/>
16.DataTemplate模板
解析:通过数据模板在一个listbox控件中为了显示多行和多列数据:
<ListBox Height="202" HorizontalAlignment="Left" Margin="21,12,0,0" Name="listBox1" VerticalAlignment="Top" Width="384" >
<ListBox.ItemTemplate >
<DataTemplate >
<StackPanel Orientation="Horizontal" >
<TextBox Width="60" Text="{Binding Path=Name}"/>
<TextBox Width="60" Text="{Binding Path=ID}"/>
<TextBox Width="60" Text="{Binding Path=Age}"/>
</StackPanel >
</DataTemplate >
</ListBox.ItemTemplate >
</ListBox >
17.WPF中的style
解析:
<Window.Resources >
<ResourceDictionary >
<Style x:Key="dgButton" TargetType="Button" >
<Setter Property="Background" Value="Blue" />
<Setter Property="FontSize" Value="20"/>
</Style >
<Style x:Key="cb" TargetType="CheckBox" >
<Style.Triggers >
<Trigger Property="IsChecked" Value="True">
<Setter Property="FontSize" Value=" 40"/>
<Setter Property="Foreground" Value="Red" />
</Trigger >
</Style.Triggers >
</Style >
</ResourceDictionary >
</Window.Resources >
调用方式为:
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="216,224,0,0" Name="button3" VerticalAlignment="Top" Width="75" Style ="{StaticResource dgbutton}"/>
<CheckBox Content="CheckBox" Height="58" HorizontalAlignment="Left" Margin="654,16,0,0" Name="checkBox1" VerticalAlignment="Top" Width="175" Style="{StaticResource cb}" Grid.Row="1" />
18.WPFtrigger主要类型
解析:
[1]Trigger、MultiTrigger、DataTrigger、MultiDataTrigger、EventTrigger
[2]trigger主要运用的场景在Style、ControlTemplate、DataTemplate三个地方
19.静态常量和动态常量
解析:
[1]静态常量[const]是指编译器在编译时候会对常量进行解析,并将常量的值替换成初始化的那个值。
[2]动态常量[readonly]的值则是在运行的那一刻才获得的,编译器编译期间将其标示为只读常量,而不用常量的值代替,这样动态常量不必在声明的时候就初始化,而可以延迟到构造函数中初始化。
20.System.Windows.Data.Binding.ElementName
解析:获取或设置要用作绑定源对象的元素的名称。
21.System.Windows.FrameworkElement.DataContext
解析:获取或设置元素参与数据绑定时的数据上下文。
22.System.Windows.Controls.UserControl
解析:提供创建的控件的简单方法。
23.System.Windows.FrameworkElement.DataContext
解析:获取或设置元素参与数据绑定时的数据上下文。
24.bool System.Windows.UIElement.Focus()
解析:尝试将焦点设定到此元素上。
25.将UserControl添加到Window窗体方法
解析:
[1]在XMAL中添加
[2]在CS代码中添加
参考文献:
[1]WPF中触发器Trigger、MultiTrigger、DataTrigger、MultiDataTrigger:https://mp.weixin.qq.com/s/uLq_2ZRPTAmv_D4icvtV7g
[2]WPF的UserControl用户控件怎么添加到Window窗体中:https://www.cnblogs.com/lelehellow/p/6026766.html