我有CustomControl派生自另一個控件,我在其資源屬性(在xaml中)設置了默認樣式。後來,我想使用此CustomControl並使用默認語法向其添加新資源:<my:CustomControl.Resources>...
WPF CustomControl - 資源屬性
我該怎麼做?目前,我收到一個錯誤:Cannot re-initialize ResourceDictionary instance.
我有CustomControl派生自另一個控件,我在其資源屬性(在xaml中)設置了默認樣式。後來,我想使用此CustomControl並使用默認語法向其添加新資源:<my:CustomControl.Resources>...
WPF CustomControl - 資源屬性
我該怎麼做?目前,我收到一個錯誤:Cannot re-initialize ResourceDictionary instance.
有幾個解決方案:
向父級資源塊添加新資源。
添加新資源作爲資源字典。
鏈接已損壞。你有沒有工作? –
我用更穩定的答案編輯了我的帖子:) – Achilleterzo