elementhost

ElementHost Layout Problems

↘锁芯ラ 提交于 2019-11-30 08:54:37
问题 I have a bunch of ElementHosts that I'm loading onto my form. When this happens, the element hosts all appear with a black background. If I bring another control to front, then close the other control, the ElementHosts are repainted normally. After some googling, I found that if I sub-class ElementHost and do this in the constructor using (CreateGraphics()) { } The ElementHosts are all drawn with good backgrounds....BUT, they take about 300ms per element host to appear on the form...and they

Application.Current in ElementHost is null

假如想象 提交于 2019-11-29 16:59:22
问题 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 = Application.Current.MainWindow; This works fine, if i use the UserControl in a WPF program. When I use the UserControl in my WindowsForms program (I set the UserControl in a ElementHost elementHost.Child = ... ) is Application.Current null. This is not good and my

ElementHost Layout Problems

故事扮演 提交于 2019-11-29 08:38:29
I have a bunch of ElementHosts that I'm loading onto my form. When this happens, the element hosts all appear with a black background. If I bring another control to front, then close the other control, the ElementHosts are repainted normally. After some googling, I found that if I sub-class ElementHost and do this in the constructor using (CreateGraphics()) { } The ElementHosts are all drawn with good backgrounds....BUT, they take about 300ms per element host to appear on the form...and they appear sequentially...so it's like watching the form getting laid out... I have, of course called

WPF control not displaying in ElementHost in WinForms app

爱⌒轻易说出口 提交于 2019-11-29 06:33:59
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, but in my WinForms app all I get is a blank grey box where the ElementHost is displayed. Here's my C# code for creating, populating, and adding the ElementHost to the parent Control: // This is my WPF control m_TabHostPanel = new TabHostPanel(); m_ElementHost = new ElementHost { Child = m_TabHostPanel, Dock = DockStyle.Top, Height = 34 }; this

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

空扰寡人 提交于 2019-11-27 13:07:00
问题 I have a Windows Forms app, that has a single ElementHost containing a WPF UserControl... in my WPF, I have a VERY simple ListView: <ListView Margin="4" ItemsSource="{Binding Notifications}"> <ListView.View> <GridView> <GridViewColumn Header="FirstName" DisplayMemberBinding="{Binding FirstName}" /> <GridViewColumn Header="LastName" DisplayMemberBinding="{Binding LastName}" /> <GridViewColumn Header="Address" DisplayMemberBinding="{Binding Address}" /> <GridViewColumn Header="City"

WPF TextBox not accepting Input when in ElementHost in Window Forms

天涯浪子 提交于 2019-11-26 19:45:49
问题 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 child window which can dock to the Engines Interface. I am attempting to put a simple WPF TextBox inside an ElementHost control, which is added to the Dockbar. This appears to work fine at first glance; but after attempting to type into the TextBox