赞
踩
近来,公司正在做一个WPF的项目,目前在项目论证与技术选型阶段。对于WPF,我是个完全的新手,而我们项目组也没有做过WPF项目,现处于技术积累阶段。遇到WPF数据双向绑定问题,在此记录之,如有错漏之处,欢迎批评指正!
一、在Model层,定义实体类City,如下:
public class City
{
[Key]
public long CityID { get; set; }
public string CityName { get; set; }
public string ZipCode { get; set; }
public long ProvinceID { get; set; }
public DateTime DateCreated { get; set; }
public DateTime DateUpdated { get; set; }
}
二、在ViewModel层,定义类CityViewModel,如下:
public class CityViewModel : INotifyPropertyChanged
{
private string _City { get; set; }
public string City
{
get
{
return _City;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。