Hi,
I use the DataProvider_DataChanged event so I can be sure an async operation has completed before I update another part of the applicaiton. Unfortunately the event seems to get raised twice for each operation. This makes me code module level booleans to record "has this already happened" quite a bit which is not great :(
A few questions:
1) Are there alternative events that only get called once e.g. Loaded, Saved etc.
2) Is there a way to examine the parameters in DataProvider_DataChanged to distinguish between the first and second call?
3) Does everyone else experience this double calling? How do you deal with it?
I still get duplicate calls in v3.6.2
I will try a few things with v3.6.2 and update if I come up with anything
As far as I can see the two calls are being driven by the highlighted lines below. Changing .Error or .ObjectInstance has the ability to call OnDataChanged.
private
void QueryCompleted(object sender, EventArgs e){
IDataPortalResult eventArgs = e as IDataPortalResult; this.Error = eventArgs.Error; this.ObjectInstance = eventArgs.Object;RefreshCanOperationsValues();
this.IsBusy = false;}
See what a second pair of eyes can do. That is a very good
observation and is a problem. Glancing at the code though, implementing a
solution is going to take a bit of refactoring…
Thank you!
Rocky
Copyright (c) Marimer LLC