Reputation: 675
I have a lot of <Style>
in <Window.Resources>
.
How can I separate <Style>
from <Window.Resources>
?
Do I have to make a new Window
file and use <Application.Resources>
?
I also have a lot of those.
in my <Window.Resources>
. Is it also possible to separate those?
Upvotes: 0
Views: 76
Reputation: 5366
You add those styles in ResourceDictionary and use it where ever required. You can add application level or Window Level. http://blogs.msdn.com/b/wpfsldesigner/archive/2010/06/03/creating-and-consuming-resource-dictionaries-in-wpf-and-silverlight.aspx
http://www.codeproject.com/Articles/35346/Using-a-Resource-Dictionary-in-WPF
Upvotes: 1
Reputation: 734
You can create a ResourceDictionary file. It's just a xaml where you can put styles, control templates etc. See here for more info: http://msdn.microsoft.com/en-gb/library/cc903952(v=vs.95).aspx
You can then attach this dictionary to your project in app.xaml.
Upvotes: 1