user310291
user310291

Reputation: 38180

cannot create event of type Action<String>

Following discuss Problem to pass the result to the caller for asynchronous httpWebRequest I tried to created an event of type Action

public event Action<string> ResponseResult;

but Silverlight refuses event keyword: it says expect class, delegate, ...

Upvotes: 0

Views: 267

Answers (2)

Kasper Holdum
Kasper Holdum

Reputation: 13353

You are defining the event in the wrong place. If you have your Helper class (reference the original post) then you need to declare the event inside this class:

public class Helper
{
     public event Action<string> ResponseResult;

     // rest of code...
}

Upvotes: 1

Dave Van den Eynde
Dave Van den Eynde

Reputation: 17405

C# is C#, whether it's against Silverlight or the .NET Framework that you're building.

My guess is that you're trying to define an event outside of the scope of a class.

Upvotes: 1

Related Questions