Tag: eventargs

.NET是否有内置的EventArgs <T>?

我正在准备为带有一个参数的事件参数创build一个通用的EventArgs类: public class EventArg<T> : EventArgs { // Property variable private readonly T p_EventData; // Constructor public EventArg(T data) { p_EventData = data; } // Property for EventArgs argument public T Data { get { return p_EventData; } } } 在我这样做之前,C#是否具有内置在该语言中的相同function? 我似乎记得在C#2.0出来的时候碰到类似的东西,但是现在我找不到它了。 或者换一种说法,我是否必须创build自己的通用EventArgs类,或者C#提供了吗? 谢谢你的帮助。

MVVM将EventArgs作为命令parameter passing

我正在使用Microsoft Expression Blend 4 我有一个浏览器.., [XAML] ConnectionView“空白代码” <WebBrowser local:AttachedProperties.BrowserSource="{Binding Source}"> <i:Interaction.Triggers> <i:EventTrigger> <i:InvokeCommandAction Command="{Binding LoadedEvent}"/> </i:EventTrigger> <i:EventTrigger EventName="Navigated"> <i:InvokeCommandAction Command="{Binding NavigatedEvent}" CommandParameter="??????"/> </i:EventTrigger> </i:Interaction.Triggers> </WebBrowser> [C#] AttachedProperties类 public static class AttachedProperties { public static readonly DependencyProperty BrowserSourceProperty = DependencyProperty . RegisterAttached ( "BrowserSource" , typeof ( string ) , typeof ( AttachedProperties ) , new […]