小编arn*_*rna的帖子

我的类不能用作 .Net 4 中泛型类型或方法“System.EventHandler<TEventArgs>”中的类型参数“TEventArgs”

我试图了解 EventHandler 并且必须使用通知项目。这是项目的链接: https ://codeload.github.com/mike-eason/WPF_ToastNotifications/zip/master

我所做的只是将 .Net-framework 从 4.5 更改为 4

我遇到了这个错误:

我的类不能用作泛型类型或方法“System.EventHandler”中的类型参数“TEventArgs”

ToastNotification类:

 [TemplatePart(Name = "PART_DismissButton", Type = typeof(Button))]
    public class ToastNotification : ContentControl
    {
        public event EventHandler Dismissed;

        public string Title
        {
            get { return (string)GetValue(TitleProperty); }
            set { SetValue(TitleProperty, value); }
        }

        public static readonly DependencyProperty TitleProperty =
            DependencyProperty.Register("Title", typeof(string), typeof(ToastNotification));

        public string Message
        {
            get { return (string)GetValue(MessageProperty); }
            set { SetValue(MessageProperty, value); }
        }

        public static readonly DependencyProperty MessageProperty =
            DependencyProperty.Register("Message", typeof(string), typeof(ToastNotification));

        public …
Run Code Online (Sandbox Code Playgroud)

c# wpf eventargs eventhandler

5
推荐指数
1
解决办法
1908
查看次数

标签 统计

c# ×1

eventargs ×1

eventhandler ×1

wpf ×1