我试图从这个https://toastspopuphelpballoon.codeplex.com/库中获取我的应用程序功能。
我做了一个简单的烤面包没有事件处理,但我无法通过点击和关闭事件获得样本工作
作为样本,我试图做一个像文档那样的简单演示 https://toastspopuphelpballoon.codeplex.com/documentation
var toast = new ToastPopUp(
"My Title",
"This is the main content.",
"Click this Hyperlink",
NotificationType.Information);
toast.HyperlinkObjectForRaisedEvent = new object();
toast.HyperlinkClicked += this.ToastHyperlinkClicked;
toast.ClosedByUser += this.ToastClosedByUser;
toast.Show();
我需要使用这个HyperLinkClicked事件来完成我的工作......
我无法弄清楚如何使用此活动
我正在尝试像
这样的东西 toast.HyperlinkClicked += new EventHandler(myevent_method);
但是vs不断向我抛出错误,我无法弄清楚如何使用这个lib处理这个事件,但我真的需要它。
希望得到你的帮助,谢谢你
答案 0 :(得分:2)
问题是方法myevent_method
必须具有以下签名:
void myevent_method(object sender, Mantin.Controls.Wpf.Notification.HyperLinkEventArgs eventArgs)
确保将处理程序添加为:
toast.HyperlinkClicked += new my_method;
或:
toast.HyperlinkClicked
+= new EventHandler<Mantin.Controls.Wpf.Notification.HyperLinkEventArgs>(my_method);
一旦你做到了这些,它应该有效。
答案 1 :(得分:0)
使用v3.2,你也可以通过一个动作来打电话......
extension=
这是NuGet包的链接.... https://www.nuget.org/packages/Mantin.Controls.Wpf.Notification