I have a bunch of Xaml vector icons inside a separated .xaml
. I load them inside my window
using this directive:
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ScreenToGif;component/Themes/IconSet.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
I have lots of windows, so I would like to simply put this code inside the App.xaml
.
I'm trying this:
<Application.Resources> <!-- Error, The property "Resources" can only be set once. -->
<ResourceDictionary x:Key="IconSet"> <!--Not sure why this?-->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Mine;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<!--Here goes the rest of the file, with Style and DropShadowEffect... -->
</Application.Resources>
So here is the problem:
All examples don't use a x:Key
attribute, but it gives me an error saying that I need.
When I do that, it says that I can't have multiple properties Resource
...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…