Following discuss Problem to pass the result to the caller for asynchronous httpWebRequest I tried to created an event of type 开发者_JAVA技巧Action
public event Action<string> ResponseResult;
but Silverlight refuses event keyword: it says expect class, delegate, ...
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...
}
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.
精彩评论