【发布时间】:2015-04-01 21:40:16
【问题描述】:
我有一个这样的虚拟机
class Vm : Notifiable
{
public string Name
{
get { return _Name; }
set { _Name = value; OnPropertyChanged("Name"); }
}
private _Name = "";
}
还有一个这样的
class CollectionVm : Notifiable
{
public ObservableCollection<Vm> Vms {get;set;}
public Vm Selected
{
get { return _Selected; }
set { _Selected= value; OnPropertyChanged("Selected"); }
}
Vm _Selected = null;
}
还有三分之一是这样的
class OuterVm : Notifiable
{
CollectionVm _collection;
public Vm Display
{
get {return _collection.Selected; }
}
}
还有这样的绑定
<TextBlock Text={Binding Display.Name}/>
我的问题是,当集合中的选择发生变化时,文本块不会更新。我怎样才能让它这样做?
【问题讨论】:
标签: c# wpf xaml inotifypropertychanged