Questions tagged [elementhost]

`Element Host` is a `Windows Forms control` that can be used to host a Windows Presentation Foundation (`WPF`) element.

120 questions
43
votes
4 answers

How do I convert a WPF size to physical pixels?

What's the best way to convert a WPF (resolution-independent) width and height to physical screen pixels? I'm showing WPF content in a WinForms Form (via ElementHost) and trying to work out some sizing logic. I've got it working fine when the OS is…
Joe White
  • 94,807
  • 60
  • 220
  • 330
28
votes
4 answers

WPF ListView Very Slow Performance - Why? (ElementHost, or Other Reason?)

I have a Windows Forms app, that has a single ElementHost containing a WPF UserControl... in my WPF, I have a VERY simple ListView:
Timothy Khouri
  • 31,315
  • 21
  • 88
  • 128
21
votes
4 answers

WPF TextBox not accepting Input when in ElementHost in Window Forms

We are developing a UI Control in WPF to be consumed within an existing Windows Forms / MFC application engine (Rhino 3D). The application engine exposes the ability create a "Dockbar" which essentially lets you put Windows Forms controls inside a…
Jason Stevenson
  • 4,004
  • 3
  • 29
  • 49
18
votes
1 answer

Application.Current in ElementHost is null

I use a WPF UserControl in my personal Libs. The Libs are included in my WPF and WindowsForms programs. Now my UserControl has to show a new (WPF) Window. At the new Window I want to set the Owner. I do it like this: dialog.Owner =…
David
  • 4,027
  • 10
  • 50
  • 102
14
votes
3 answers

Rendering issue with WPF controls inside ElementHost

I am having a WinForms control, inside that I have a TableLayoutPanel which holds multiple ElementHosts and each ElementHost contains a WPF control. Everything works fine except when the size of controls is bigger then window and ScrollBar is there;…
akjoshi
  • 15,374
  • 13
  • 103
  • 121
13
votes
1 answer

Text renders differently on WPF window and inside ElementHost

I use WPF interoperability to host WPF user control inside WinForms form. Everything works OK except ugly text rendering:
Dmitry Karpezo
  • 1,054
  • 11
  • 26
11
votes
3 answers

Loading/Using Resource Dictionaries from a WinForms hosted WPF control

I have a Windows Forms application that needs to host a WPF control at runtime. I have the basic hosting and interaction complete (using an ElementHost control) and everything works fine until I try to do something that requires the WPF control to…
Scott Dorman
  • 42,236
  • 12
  • 79
  • 110
11
votes
1 answer

WPF control not displaying in ElementHost in WinForms app

I have a problem with a WPF control that I'm trying to host in an ElementHost in a WinForms app. The control is a lookless custom control that I originally developed in a separate test project, which was a WPF app. In there it obviously works fine,…
Bart Read
  • 2,717
  • 3
  • 22
  • 32
9
votes
1 answer

ElementHost size causes slow wpf open/load with high memory usage

The Problem: We have a Winforms application, which can open up another WPF Window. This window contains various icons and text and isnt overly complex. Back to the main window, the winforms one, this also has a WPF control embedded using…
user3483066
  • 131
  • 5
8
votes
2 answers

Auto size ElementHost to its content

I have a small WPF control that has a TextBlock with TextWrapping set to Wrap. I am trying to host this in an existing WinForms application. I have the ElementHost docked to the top of the form, and I would like to size the height of the ElementHost…
Brian Kohrs
  • 279
  • 3
  • 9
7
votes
3 answers

WPF ShowDialog and ElementHost

is it possible to display a Modal Window from a WPF User Control, that is a child of an ElementHost, and set the owner/parent of the Modal Window to the containing Form control? I'm guessing you can't do this, as the Owner property takes an instance…
James
6
votes
1 answer

Hosted Winform control does not respond to events from WPF

This is my first question in StackOverflow. Due to lack of reputations, I couldn't post any links or images. I've been working on the following issue for more than 2 days. Any help would greatly be appreciated. Before I get into my question, here is…
raj
  • 61
  • 3
6
votes
4 answers

How to clear memoryleak from ElementHost Control

I have a requirement to host WPF Control on Winform User control. To achieve this I used ElementHost control. When I run Ants Memory profiler , I got know that There is a Huge memory leak in the ElementHost control. Please find the attached…
naveen
  • 1,451
  • 6
  • 21
  • 27
5
votes
3 answers

Dynamic Application-level resources are not dynamic when hosted in ElementHost

I'm hosting a WPF UserControl in a WinForms container. Now, I want to be able to theme/skin the UserControl. To do this, I've got several resource dictionaries that define the "skins." When my app starts up I create a "new…
dustyburwell
  • 5,755
  • 2
  • 27
  • 34
5
votes
2 answers

ElementHost + FlowDocument = GC not working, memory keeps increasing

[Updated, see bottom!] There is a memory leak in our WinForms application hosting a WPF FlowDocumentReader in an ElementHost. I have recreated this issue in a simple project and added the code below. What the application does When I press…
svinja
  • 5,495
  • 5
  • 25
  • 43
1
2 3 4 5 6 7 8