I need to apply theme file in windows form but I can't. When I use the code below I get error because there is no System.Windows.Application
StreamResourceInfo sri = System.Windows.Application.GetResourceStream( new Uri("App.xaml", UriKind.Relative));
var resources = (System.Windows.ResourceDictionary)Load(sri.Stream);
var app = new System.Windows.Application(); app.Resources.MergedDictionaries.Add(resources);
Thank you
How to apply .xaml file in windows form
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Selva GanapathyRank #560 · 4.3K reputationPosted Dec 9, 2014, 2:55 AM EST
Hi Onur,
To which control you are trying to do this?
Regards,
Selva Ganapathy K
Vahid Bakhtiary132 reputationPosted Dec 9, 2014, 4:10 AM EST
after that you must add a elementhost control in your windows form and after that in code behind use below code :
UserControl1 us = new UserControl1();
elementHost1.Child = us;