带有GUI作为插件的DLL [英] DLL with GUI as plugin

查看:124
本文介绍了带有GUI作为插件的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个DLL,该DLL将作为扩展集成到另一个项目中.
此DLL必须具有gui.我的首选解决方案是使用WPF创建此GUI,但是我不知道如何使用所有这些XAML内容创建纯DLL.

第二好的方法是从DLL中调用FORM.在集成插件之前,此方法工作正常.问题在于,DLL需要部署到System32,而另一个应用程序位于其他任何地方.因此ShowForm()方法不起作用.

有谁有解决方案的想法吗?

问候

Martin

I want to create a DLL which shall be integrated as extension into another project.
This DLL must have a gui. My preferred solution would be using WPF for creating this GUI, but I don''t know how to create a plain DLL with all this XAML stuff.

The second best would be to call a FORM from within the DLL. This works fine until I integrate the pluging. The problem is, that the DLL needs to be deployed to System32 and the other application is situated anywhere else. So the ShowForm() method does not work.

Is there anyone with an idea for a solution?

Regards

Martin

推荐答案

出于某些高级考虑,请检查我过去对类似问题的回答:
创建使用可重载插件的WPF应用程序... [ ^ ],
AppDomain拒绝加载程序集 [动态加载用户控件 [
For some advanced consideration, please check my past answers on the similar questions:
Create WPF Application that uses Reloadable Plugins...[^],
AppDomain refuses to load an assembly[^],
Dynamically Load User Controls[^].

—SA


Microsoft产生了此复合应用程序指南 [ ^ ]以帮助分解Monolithic WPF/Silverlight应用程序.我只是在进入Winforms经典项目时才开始使用它的,所以我可以提供更多帮助,但这听起来像是您需要的东西.
Microsoft Produced this Composite Application Guidance[^] to help break up Monolithic WPF/Silverlight apps. I only got started with it when I was move to a Winforms classic project, so I can provide more help, but it sounds like the type of thing you need.


我已经完成了这有很多方法.

弹出DLL UI作为表单,它在用户看来将是主应用程序中的表单.
以嵌套在主应用程序中用户控件内的无边界形式弹出DLL UI.
在DLL中实现用户控件并将其用作您的UI.

我已经完全使用WinForms做到了这一点.

实际上,考虑到这一点,我有一些示例代码可以解决您的问题,
[
I''ve done this in a number of ways.

Pop up the DLL UI as a form, it''ll appear to the user to be a form within the main App.
Pop up the DLL UI as a borderless form nested within a user Control in the main App.
Implement user Controls within the DLL and use those as your UI.

I''ve done this with WinForms with absolutely no problems whatsoever.

Actually, now that I think about it, I have some sample code that might solve your problem,
Here[^]

If you have any specific issues feel free to come back to me.

Good Luck.

-Richard


这篇关于带有GUI作为插件的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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