【发布时间】:2013-04-12 15:30:11
【问题描述】:
类 ChildViewModel : ParentViewModel
class ParentViewModel 有 -> public string PropertyA;公共字符串PropertyB;
我有 2 个屏幕选项卡工作流程,一个用于父级,另一个用于子级(显然取决于父级数据)。 我想将 PropertyA 绑定到 childView 中的文本块,这样当我将 screentab 更改为 parentView 并修改 PropertyA 时,它应该自动反映在 childView 中。
我在 childViewModel 中定义了一个属性(排序伪):
public string PropA
get { return PropertyA; }
set
{
PropertyA = value;
OnPropertyChanged("PropertyA");
}
我也尝试过 UpdateSourceTrigger, Mode=twoway 视图中的属性 - WPF。
仍然无法更改属性。
欢迎提出任何建议......
【问题讨论】:
标签: c# .net wpf data-binding