开发者

cannot create event of type Action<String>

开发者 https://www.devze.com 2023-02-20 03:04 出处:网络
Following discuss Problem to pass the result to the caller for asynchronous httpWebRequest I tried to created an event of type 开发者_JAVA技巧Action

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号