ResourceDictionary is not derived from DependencyObject. You can solve this problem, by finding a suitable object in the final visual tree (after the resource is embedded), that is derived from DependencyObject and attaching these two properties to it.
↧