Hello,
我不知道你为什么想这样获取资源字典里面的内容,但是如果你实在想这样做的话, 你可以尝试下面的代码:
foreach (ResourceDictionary rd in Application.Current.Resources.MergedDictionaries
.Where(x => x.Source.ToString() == "VisibilityResources.xaml")
)
{
foreach (DictionaryEntry de in rd)
{
Console.WriteLine(de.Key + " : " + de.Value.ToString());
}
}
Best Regards,
Cherry
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.