.netwpfwinformstelerikwinforms-interop

WPF Telerik Controls disappear while hosting application in WinForms


The main application is developed in .NET Framework 4.8 and WinForms. The sub application that I try to host is an .NET Framework 4.8 WPF App, too. Every view is an User Control, so that the host can theoretically display it. At one point the controls were shown but only some. The added theme also couldn't be shown.

The WinForms App is not ready to get updated to .NET Core or even .NET 5.

For hosting the WPF App I use the WPF Host Control in WinForms. The problem is, that "native" WPF Controls can be displayed and Telerik Controls disappear while get hosted in the WinForms Application. If I start the WPF Application standalone, everything is shown and can be used.

I installed the NuGet Packages on both Projects.

WPF Application WPF App without Hosting

WinForms App WinForms App and hosted wpf client

You can see in the example above that the box at the bottom can be shown. Everything else is not existing. The Code is compiling and I can step through the Code-behind from the Views initialization.


Solution

  • I contacted the Telerik support that helped me a lot. So the problem is based on the fact that every NuGet Package from Telerik has two "Versions". The NOXAML and a XAML Assembly. Telerik directly warns from mixing NOXAML and XAML Assemblies in one project. The XAML Assemblies include Styles and everything, whereas NOXAML doesn't. This means that NOXAML Assemblies are lighter and smaller in comparison to XAML Assemblies.

    If you run into visual problems at runtime, check if you mixed these Assembly Types and decide to use only one of them!

    See also Telerik Documentation

    I hope that this post helps someone in the future :D