Search code examples
expression-blendblend

blend 4 code behind


I am designing a template in belnd 4. I am new to .net and blend. I am trying to link a click event to the button but when I go tp properties and click the Events, I get this

The document item has no code-behind file. Add a code-behind file and a class before adding event handlers

I will appreciate help


Solution

  • I think you are trying to add an event handler for a button which is inside a ResourceDictionary file. A ResourceDictionary is just for storing control's styles. You can only do that in a UserControl or Page.