I am working on a Silverlight / WCF application and, of course, have many asynchronous calls in a Silverlight program. I was wondering how to best deal with creating client classes and subscribing. In particular, if I subscribe to an event in a method, after it returns, it falls out of scope?
internal MyClass
{
public void OnMyButtonClicked()
{
var wcfClient = new WcfClient();
wcfClient.SomeMethodFinished += OnMethodCompleted;
wcfClient.SomeMethodAsync();
}
private void OnMethodCompleted(object sender, EventArgs args)
{
}
}
Am I having problems if I call the function again and create another subscription?
Thanks in advance to everyone who answers.
source
share