wpf中处理程序的用途是什么? [英] what is the use of handlers in wpf ?

查看:76
本文介绍了wpf中处理程序的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的wpf项目中,我见过一些wpf处理程序(拖放处理程序,鼠标行为处理程序)...有谁能请解释一下wpf中的处理程序?

In my wpf project i had seen some wpf handlers (dragdrop handler,mouse behaviour handler)... can anyone please explain me breifly about the handlers in wpf?

推荐答案

简短的回答是:您认为在没有处理程序的情况下使用UI会怎样?没有它们就没有UI。而且不仅仅是UI。这与询问编程中函数的用途是什么?相同。 :-)



它甚至不是WPF,这是一般的CLR,以及.NET和CLR之外的许多技术中许多非常相似的人员。< br $> b $ b

不,读取原始MSDN文档很难让你更容易:

https://msdn.microsoft.com/en-us/library/edzehd2t%28v=vs.110%29。 aspx [ ^ ](这可能更简单一点吗?),

https://msdn.microsoft.com/en-us/library/aa645739%28v=vs.71%29.aspx [ ^ ]。



但是,WPF在事件中引入了自己的扭曲,但在绝大多数情况下,这是先进的东西,所以你可以做很多工作而不理解它们:

https://msdn.microsoft.com/en-us/library/ms753115%28v=vs.110%29.aspx [ ^ ],

< a href =https://msdn.microsoft.com/en-us/library/ms742806%28v=vs.110%29.aspx> https://msdn.microsoft.com/en-us/library/ms742806 %28v = vs.110%29.aspx [ ^ ],

https://msdn.microsoft.com/en-us/magazine/cc785480.aspx [ ^ ],

http://www.wpf-tutorial.com/xaml/events-in-xaml [ ^ ]。



当然,最终你需要学习所有这些WPF特定的东西,但不要早于你理解一般事件概念,这些概念并不像有些人认为的那样微不足道。基本的日常体验。



-SA
Short answer is: and what do you think would be the use of UI without handlers? There is no UI without them. And not only UI. This is the same as asking "what is the use of functions in programming?" :-)

It's not even WPF, this is the general CLR thing, as well as a lot of very similar staff in many technologies outside .NET and CLR.

No, it's hard to make it easier for you than reading of original MSDN documentation:
https://msdn.microsoft.com/en-us/library/edzehd2t%28v=vs.110%29.aspx[^] (what could be more brief that this one?),
https://msdn.microsoft.com/en-us/library/aa645739%28v=vs.71%29.aspx[^].

However, WPF introduces its own twist to events, but, in vast majority of cases, this is advanced stuff, so you can do a lot of work without understanding it all:
https://msdn.microsoft.com/en-us/library/ms753115%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/ms742806%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/magazine/cc785480.aspx[^],
http://www.wpf-tutorial.com/xaml/events-in-xaml[^].

Of course, eventually you would need to learn all this WPF-specific stuff, but not sooner than you understand general event concepts, which are not so trivial as some may think based on basic everyday experience.

—SA


这篇关于wpf中处理程序的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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