我们要触发事件,事件名称保存在 SQL Server 中
在 SQL Server 中,您会发现 ApplicationExitRequestEvent 当我们单击菜单按钮时,我们将从 MenuItem 中获取字符串
Type t = Type.GetType(SelectedMenu.View + "," + "AssemblyName");
var obj = Activator.CreateInstance(t);
if (t != null)
{
//Working firing Event with className
EventAggregator.GetEvent<ApplicationExitRequestEvent>().Publish(null);
//Generic?
EventAggregator.GetEvent<???>().Publish(null);
}
有可能吗?使用 PRISM 和 MVVM - WPF - .NET 4.0