Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

C#
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
Posted

1 solution

Windows Forms and WPF are two distinct technologies.  You can't mix and match them.  However, you can host a WPF control in a Windows Forms control (and vice-versa).  See these links for more informarion:

/ravi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900