我有这样的类型:如何在不更改下一个aspect-node的旧值的情况下获取新值?
[NotifyPropertyChangedAspect]
public class MyDataModel
{
...
[OnSetAspect("OnSelectedUserChanged")]
public string SelectedUser { get; set; }
...
}
上,我将这些方面的内容:每个类方面:
[Serializable]
public class NotifyPropertyChangedAspect : LocationInterceptionAspect
{
...
public override void OnSetValue(LocationInterceptionArgs args)
{
var newValue = args.Value;
var oldValue = args.GetCurrentValue();
args.ProceedSetValue();
//base.OnSetValue(args); // same effect of ProceedSetValue()
... /* some more stuff... */ ...
}
...
}
和每场看点:
[Serializable]
public class OnSetAspect : LocationInterceptionAspect
{
...
public override void OnSetValue(LocationInterceptionArgs args)
{
var newValue = args.Value;
var oldValue = args.GetCurrentValue();
args.ProceedSetValue();
//base.OnSetValue(args); // same effect of ProceedSetValue()
... /* some more stuff... */ ...
}
...
}
现在发生的事情是NotifyPropertyChangedAspect.OnSetValue(...)
被调用,当它调用args.GetCurrentValue()
时,args.Value
更改其值(作为aspe中下一个节点的结果cts绑定,我猜),所以当调用OnSetAspect.OnSetValue(...)
时,args.Value
不再有效。
这两个方面都应该检查以前的值和新的值(意味着要设置的值)并相应地做一些事情。
他们不改变要设置的值,所以他们不应该相互影响,但他们做的......
我怎样才能让这两个方面解开?