赞
踩
在网上找到类似的代码:
XAML文件
对应的ViewModel文件
public classLocationRoad
{public int ID { set; get; }public string Code { set; get; }public string Info { set; get; }
}/当ComboBox选中项更改时发生///privateLocationRoad _selectLocation;publicLocationRoad SelectLocation
{get{return this._selectLocation;
}set{this._selectLocation =value;if (this.PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("SelectLocation"));
}
}private ObservableCollection _locationRoad = null;publicObservableCollection LocationSource
{get{if (this._locationRoad == null)
{this._locationRoad = newObservableCollection() {new LocationRoad() { ID = 1, Code = "NGQ", Info = "南岗区"},new LocationRoad() { ID = 2, Code = "DLQ", Info = "道里区"},new LocationRoad() { ID = 3, Code = "DW
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。