文章分类 - WPF
摘要:<XmlDataProvider x:Key="valueCob" XPath="values"> <x:XData> <values xmlns=""> <item val="1"></item> <item val1="2"></item> <item val="3"></item> <item val="4"></item&g
阅读全文
摘要:代码如下:后台自定义类:public class Person:INotifyPropertyChanged { private string name; public event PropertyChangedEventHandler PropertyChanged; public string Name { get { return name; } set { name = value; if (PropertyChanged != null) { this.PropertyChanged.Invoke(thi...
阅读全文
摘要:public class Student { private string name; public string Name { get { return name; } set { name = value; } } private int age; public int Age { get { return age; } set { age = value; } ...
阅读全文
摘要:DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Columns.Add(new DataColumn("Age", typeof(string))); dt.Columns.Add(new DataColumn("Sex", typeof(string))); DataRow dr = dt.NewRow(); dr[0] = "Ja...
阅读全文
摘要:要支持鼠标事件,则Background不能为Null,而UserControl默认的Background为Null,所以导致鼠标事件不起作用,而Window默认Background是不为Null的,所以也就支持鼠标事件。
阅读全文
摘要:DataTrigger中使用Converter时,绑定的属性需要使用ElementName或者RelativeSource Self才能找到该属性,像绑定TextBox的Text,如果直接使用Binding Text或者RelativeSource TemplatedParent是找不到对应的属性的,导致Converter不起作用。
阅读全文
浙公网安备 33010602011771号