Winform程序调用wpf窗口 [英] Winform programs invoke wpf window

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

问题描述

我的程序一个基于winform的程序,它将嵌入数学方程编辑的功能;我下载了一个由WPF编写的开源数学编辑程序。所以我必须在一个基于winform的程序中使用WPF窗口。我设置 WPF程序   class 库,并在测试中引用项目,但程序无法运行。当程序运行时,它抛出异常,innerException    找不到名为'ToolbarButtonStyle'的资源,资源名称区分大小写。我是 new   WPF中的class =code-keyword>,并且不知道如何解决问题。





我要使用的wpf程序网址是 OOP in the真实世界 - 创建公式编辑器 [ ^ ]



任何人都可以给我在winform程序中使用此wpf窗口的示例?



我尝试过:



我创建一个示例winform项目,并引用wpf类库,但它仍然抛出相同的异常

解决方案

这里有几篇关于CodeProject的文章和在网上解释这个:



如何在Windows窗体应用程序中轻松托管WPF控件 [ ^ ]

在WinForms中集成WPF UserControl [ ^ ]

混合WPF和WinForms [ ^ ]

IBlog JohanDanforth - 从WinForms打开一个WPF窗口 [ ^ ]

如何将WPF窗口添加到WinForms应用程序 - 堆栈溢出 [ ^

My program is a winform-based program, which will embed the function of math equation edit; I download an open source math edit program, which was written by WPF. So I must use a WPF window in a winform-based program.I set the WPF program as a class library, and refer it in a test project, but the program can’t run.When the program runs,it throws exception,the innerException is "Cannot find resource named ‘ToolbarButtonStyle’,Resource names are case sensitive".I’m new in WPF,and don’t know how to fix the problem.



the wpf program url that i want to use is
OOP in the Real World - Creating an Equation Editor[^]

can anyone give me a sample using this wpf window in winform program?

What I have tried:

I create a sample winform project ,and refer the wpf class library,but it still throw the same exception

解决方案

There are several articles here on CodeProject and on the web explaining this:

How to Easily Host WPF Control inside Windows Form Application[^]
Integrate WPF UserControls in WinForms[^]
Mixing WPF and WinForms[^]
IBlog JohanDanforth - Open a WPF Window from WinForms[^]
How to add a WPF window to a WinForms App - Stack Overflow[^]


这篇关于Winform程序调用wpf窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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