开发者

WPF Plug-ins in Windows Forms application

开发者 https://www.devze.com 2023-04-04 11:12 出处:网络
I am used to WPF Development. But recently, i am assigned to Windows Forms projects. Fortunately, application framework supports pluggable architecture and that\'s why i feel i can develop plugin in W

I am used to WPF Development. But recently, i am assigned to Windows Forms projects. Fortunately, application framework supports pluggable architecture and that's why i feel i can develop plugin in WPF.

If we safely assume t开发者_Python百科hat framework doesn't need more than a interface to detect a plugin, I have following questions:

  1. First of all, is it a good idea to develop WPF plugin for the given scenario?
  2. Are there any guidelines available which i should follow? Any Examples?
  3. Will it be a good idea to design some abstraction layer specially for WPF plugins rather than depending on interface?

Thanks in advance.


Yeah, we have huge project called "Plugins" which is basically WPF App/Windows loaded via additional app domain.

I think in your case depends if you Windows Forms are in .NET 2 or .NET3.5. If it is .NET 3.5 then you dont need additional app domain to load .NET 3.5 with WPF.

If you are already in .NET 3.5 with your WinForms, then you can use ElementHost to host your WPF inside WinForms.

Apart from few glitches (like not repainting the form sometimes), it went quite smoothly in our case

As to your Qs:

  1. Usually it is better to do everything in WPF, but do u have a choice ? (I dont think so)

  2. Lookup an example on WPF ElementHost

  3. Well, I would use MVVM with WPF so that later on you can chnage the UI bit (maybe Silverlight or Win8 metro) without chnaging much of the business layer logic

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号