I have several custom WPF controls whose visual representations are defined by a XAML template. My goal is to define a RadContextMenu in a ResourceDictionary and then, in code, assign it to be the context menu for my custom controls, similary to the following:
ResourceDictionary resourceDictionary =
Grid mainGrid = Template.FindName(
At runtime, the RadContextMenu gets assigned correctly, but whenever I right-click on my custom control the following exception is thrown:
System.InvalidOperationException: Cannot perform action because the specified Storyboard was not applied to this object for interactive control.
I've noticed that others have gotten a similar exception with the RadTreeView and RadTransitionControl, and I need to know what to do for a workaround on this. Is the problem related to the fact that I am using a control template?