In my library I want to create TabItem
s in a method. The TabItem
s should use a Template
which is defined in a ResourceDictionary
in another assembly.
While searching for a solution I found the following code:
ResourceDictionary res = (ResourceDictionary) Application.LoadComponent(new Uri("BaseLib.WPF.Skinning;component/BaseStyles.xaml", UriKind.Relative));
If I execute the code I get a FileNotFoundException
within the target-assembly. The assembly BaseLib.WPF.Skinning
is added as reference to the project.
How can I access my ResourceDictionary
from my code?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…