I have WPF control placed on Windows Forms SplitContainer with ElementHost. When I dragged the splitter, I got unpleasant artifacts on place of my WPF control. How can I manage with that trouble.
Asked
Active
Viewed 349 times
1 Answers
0
In my experience hosting WPF controls in a ElementHost is never perfect and always produces some rendering issues. There's some discussion on a few workarounds here that might help.
-
Thank you. I've found an issue of my problem there. I've disabled hardware accelaration of WPF Control rendering. Code:`code`public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); this.Loaded += delegate { var source = PresentationSource.FromVisual(this); var hwndTarget = source.CompositionTarget as HwndTarget; if (hwndTarget != null) { hwndTarget.RenderMode = RenderMode.SoftwareOnly; } }; } }`code` – lce Jul 27 '11 at 14:37