How to apply .xaml file in windows form

_MeRKeZ_

New member
Joined
Dec 7, 2014
Messages
1
Programming Experience
Beginner
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#:
[/FONT][/COLOR][COLOR=#000000][FONT=Arial]
[COLOR=#222222][FONT=Verdana]StreamResourceInfo sri = System.Windows.Application.GetResourceStream([/FONT][/COLOR][/FONT][/COLOR]new Uri("App.xaml", UriKind.Relative));
            var resources = (System.Windows.ResourceDictionary)Load(sri.Stream); 
            var app = new System.Windows.Application();
[COLOR=#000000][FONT=Arial][COLOR=#222222][FONT=Verdana]            app.Resources.MergedDictionaries.Add(resources);
[/FONT][/COLOR][/FONT][/COLOR]

Thank you
 
Top Bottom