2011-02-28 76 views
1

我有CustomControl派生自另一個控件,我在其資源屬性(在xaml中)設置了默認樣式。後來,我想使用此CustomControl並使用默認語法向其添加新資源:<my:CustomControl.Resources>...WPF CustomControl - 資源屬性

我該怎麼做?目前,我收到一個錯誤:Cannot re-initialize ResourceDictionary instance.

回答

0

有幾個解決方案:

  1. 向父級資源塊添加新資源。

  2. 添加新資源作爲資源字典。