Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I created a control that is a simple class derived from a ToggleButton that controls the color of the Background and Foreground depending on values of the DataContext. It works find when directly used, but I get an exception when this is used in an XML resource dictionary:

Cannot create unknown type '{clr-namespace:Fox.UI.Module.OutlookBarTool.Controls}BrokerColorToggleButton'.


I was trying previously to use a behaviour for the same, but also got a similar error. Any ideas?
Posted

1 solution

this one says that you might use incorrect Build Action
 
Share this answer
 
Comments
Clifford Nelson 29-May-13 18:10pm    
The ResourceDictionary works fine for other styles, that includes ToggleButton, so very unlikely that is the problem
Irina Pykhova 29-May-13 18:57pm    
what BuildAction you use for this ResourceDictionary? We always use Page in WPF projects. I don't remember why exactly, apparently there were problems with other BuildActions.
Clifford Nelson 29-May-13 19:42pm    
That worked. Thanks. May fix some other issues I have had with using resources.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900