本文介绍了举起活动的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

if(currentDesigner!= null)

{

e = new MouseButtonEventArgs(InputManager.Current.PrimaryMouseDevice,

e.Timestamp,

MouseButton.Left);



currentDesigner.OnMouseLeftButtonDown(发件人为AnnContainer,e);

}



在上面提到的代码中,我在最后一行得到一个例外(currentDesigner.OnMouseLeftButtonDown(发件人为AnnContainer,e);)



例外:每个routedeventargs都必须有一个与之关联的非空路由事件。



请尽快回复



我尝试了什么:



我试图让e.Handled = false但是它不起作用

if (currentDesigner != null)
{
e = new MouseButtonEventArgs(InputManager.Current.PrimaryMouseDevice,
e.Timestamp,
MouseButton.Left);

currentDesigner.OnMouseLeftButtonDown(sender as AnnContainer, e);
}

In above mentioned code i am getting an exception in last line(currentDesigner.OnMouseLeftButtonDown(sender as AnnContainer, e);)

Exception:Every routedeventargs must have a non-null routed event associated with it.

Please reply as soon as possible

What I have tried:

I try to make e.Handled=false but its not working

推荐答案

e = new MouseButtonEventArgs(InputManager.Current.PrimaryMouseDevice, e.Timestamp, MouseButton.Left);
e.RoutedEvent = UIElement.MouseLeftButtonDownEvent;
currentDesigner.OnMouseLeftButtonDown(sender as AnnContainer, e);


这篇关于举起活动的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 20:21