【发布时间】:2009-02-17 17:09:30
【问题描述】:
好的,这个问题真的很难用一行来问。这是交易。如果我有这个 XAML:
<ResourceDictionary
x:Class="MyAssembly.MiscResources"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="MyBrush" Color="Purple" />
</ResourceDictionary>
然后我在一些 C# 中有这个:
var dict = new MiscResources();
dict 被创建并且似乎正常运行,但它有 0 个元素。并不是说这是某种必要的行为,但我完全不明白为什么它不起作用。我错过了什么?
【问题讨论】:
标签: c# .net wpf silverlight xaml