Development of a Silverlight application that communicates with the WCF service.
MVVM → ServiceAgent → WCF Service
So, in my ViewModel model, I have:
ServiceAgent.SearchExternalPatients(Name, (s, e) =>
{
ExternalPatients = e.Result;
});
in my service agent i:
public void SearchExternalPatients(string name, EventHandler<SearchPatientExternalCompletedEventArgs> callback)
{
_proxy.SearchPatientExternalCompleted += callback;
_proxy.SearchPatientExternalAsync(name);
}
The problem is that every time I click the search button, it fires the event again, and when I get the result back, I get it several times.
What is the best way to undo these events in the MVVM ServiceAgent template?
source
share