简体   繁体   English

在WPF应用程序中嵌入Windows.Form

[英]Embed Windows.Form in WPF application

I was wondering, is there a consequence to embed a Windows.Form element in a WPF application ? 我想知道,在WPF应用程序中嵌入Windows.Form元素是否有结果?

I don't really know the difference between both architectures, but mixing them can have negative impacts ? 我真的不知道两种体系结构之间的区别,但是混合使用它们会产生负面影响吗?

There are always consequences with such choices. 这样的选择总会有后果。 Mainly winform doesn't support wpf event mechanism for bubbling event and dependency properties, you have to wrap it up if you want to use some binding and follow the MVVM pattern. Winform主要不支持用于冒泡事件和依赖项属性的wpf事件机制,如果要使用某些绑定并遵循MVVM模式,则必须将其包装起来。

Besides, it will not be a part of the visual tree if I remember well. 此外,如果我还记得的话,它不会成为视觉树的一部分。 It will create an other form over the form of your application, ie an other window handle... 它将在您的应用程序的表单上创建另一个表单,即另一个窗口句柄...

Not impossible, but You got to wondering yourself If it is worth it. 并非没有,但是您必须怀疑自己是否值得。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM