0

I am looking at the possibility to host a WPF control inside a Winforms application. The reason for this is some animations inside the WinForms application. WPF should be able to support this way better because it (mostly) uses the graphic card to render instead of the CPU.

Now my question:

Are there any cons of hosting a WPF Control inside a Winforms application? Does the WPF Control still use the graphic card for the rendering or does it loose some of its advantages?

Thanks for your help. If you have any inputs or tips feel free to tell me.


EDIT

I found a similar question (but maybe that one is a bit more general, I focus more on the rendering):

Any disadvantage to using an ElementHost to host a WPF UserControl in a Winform application?

Community
  • 1
  • 1
El Mac
  • 3,256
  • 7
  • 38
  • 58

1 Answers1

1

Mainly it behaves very like in a normal WPF Application.

But sometimes there are little unexpected behaviors. And it should use the hardware rendering if it would be using in normal wpf applications (depending on your configuration)

Sometimes i had problems with correctly recevien some keyboard keys in events. but there are a lot of artikels descriping the problems and solutions.

For example with some controls you could have problems catching keys. So you should have a look at System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop

-> also see this blogpost

Boas Enkler
  • 12,264
  • 16
  • 69
  • 143