WPF InkCanvas:处于墨水模式时,我可以触发children_mousedown、children_mouseup 事件吗?
在 InkCanvas
中,我有一些 UIElement
作为子项。
UIElement
具有 uielement_mousedown
、uielement_mouseup
等事件。
如果我处于 inkcanvas 墨迹模式,我可以触发 uielement_mousedown
吗? >、uielement_mouseup
事件?
In an InkCanvas
, I have some UIElement
s as children.
UIElement
s have events like uielement_mousedown
, uielement_mouseup
etc.
If I am in inkcanvas ink mode, can I fire the uielement_mousedown
, uielement_mouseup
events?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以触发事件并从 inkCanvas 处理它们。只是它们不会在墨迹模式下响应用户响应,因此如果
InkCanvas
中的子UIElement
是固定托管的(即不在运行时添加),则您可以处理UIElement
的 moseEnter 和 mouseLeave 事件,并且在MouseEnter
中,您将InkCanvas
EditingMode
更改为选择并在MouseLeave
将EditingMode
更改为 Ink。这样,当鼠标位于其中时,它们就会对用户输入(按键、鼠标等)做出响应。这能回答您的疑问吗?
You can always fire the events and handle them from inkCanvas. Its just that they will not act to the user response in ink mode, so if child
UIElement
s within theInkCanvas
are fixed hosted (i.e. not added at run time), you can handle the moseEnter and mouseLeave events for theUIElement
and in theMouseEnter
you will change the theInkCanvas
EditingMode
to Select and atMouseLeave
change theEditingMode
to Ink. This way they become responsive to the user input (key, mouse etc.) while mouse is in them.Does this answer your query?