0
我有一个类RuleDependency和两个属性IsNull
和ValueTypeEnabled
。 我们为我们的用户界面使用silverlight,我希望具有以下功能。 当IsNull
属性发生变化时我希望提高第二个属性PropertyChanged
事件:ValueTypeEnabled
。请注意,这是一个部分类,作为来自web服务的类的扩展,并且我只在参考中有IsNull
Property
,所以我不能在IsNull Property
的设置器上为我的ValueTypeEnabled
提供RaisePropertyChanged
。 我也做了以下内容:问题引发使用PropertyChanged委托多个PropertyChanged事件
public partial class RuleDependency
{
public RuleDependency() {
PropertyChanged += RuleDependency_PropertyChanged;
}
private void RuleDependency_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "IsNull") {
this.RaisePropertyChanged("IsNull");
this.RaisePropertyChanged("ValueTypeEnabled");
}
}
private bool _valueTypeEnabled;
public bool ValueTypeEnabled
{
get {
return (IsNull == null || !IsNull.Value)
}
}
}
对于未知的原因,修改IsNull property
这么想的提高事件ValueTypeEnabled
财产。我可能在解释我在这里所做的一切时犯了一些错误,但这对我来说是新的,所以请和我一起袒护。
任何帮助将被折衷。