在视口上重叠画布以捕获WPF中的鼠标事件 [英] Overlapping the Canvas on the viewport to catch mouse events in WPF

查看:122
本文介绍了在视口上重叠画布以捕获WPF中的鼠标事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现最近有关​​WPF 3D图表的文章非常有帮助. (http://www.codeproject.com/KB/WPF/WPFChart3D.aspx) 我正在寻求了解如何在我自己的WPF 3D应用程序中捕获鼠标按下事件.我尝试了宣告Canvas并捕获其鼠标事件的文章技术.但是,它对我不起作用.是否有人知道是否必须在XAML中声明viewPort才能使此技术起作用.目前,我的viewPort是用C#代码在XAML中用画布声明的.

I found a recent article on WPF 3D charts very helpful. (http://www.codeproject.com/KB/WPF/WPFChart3D.aspx)  I am seeking to understand how to catch mouse down events in my own WPF 3D App. I tried the article technique of declaring a Canvas and catching its mouse events. However it is not working for me. Does anyone know whether the viewPort has to be declared in XAML for this technique to work. Currently my viewPort is declared in C# code with the canvas in XAML.

感谢您抽出时间回答我的问题.

Thanks for your time in answering my question.

问候,

Nick Fitzsimons

Nick Fitzsimons

推荐答案

我发现您最近的WPF 3D图表文章真的很有帮助.
I found your recent WPF 3D Chart article really helpful.

此网站不是由一个人甚至一个合并的公司运营.大部分阅读此书的人都不知道您在说什么文章.如果您对文章作者有疑问,可以在文章下方找到一个论坛.如果您有一般性问题,请链接到相关文章,或者如果不相关则不要提及.

This site is not run by one person, or even a consolidated company. Most people who read this will have no idea what article you''re talking about. If you have a question for an article author, there''s a forum under the articles. If you have a general question, link to a related article, or don''t mention it, if it''s irrelevant.

您能告诉我是否必须在XAML中声明viewPort才能使该技术起作用.目前,我的viewPort在C#代码中用XAML的画布声明.
Can you tell me whether the viewPort has to be declared in XAML for this technique to work. Currently my viewPort is declared in C# code with the canvas in XAML.

什么都不需要仅在XAML中声明,如果它存在,它就已经存在. XAML只是创建相同对象的另一种方法.

Nothing EVER needs to be declared only in XAML, if it exists, it exists.  XAML is just another way to create the same objects.


这篇关于在视口上重叠画布以捕获WPF中的鼠标事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆