I have a project with a Templated Silverlight Control. When I add the DLL from the Project (with Templated Control) in my MainPage and want to open the Context Menu with a right click, I get this error:
MainPage.xaml
<MyControls:Draw x:Name="ctrDraw"></MyControls:Draw>
Draw.cs (Templated Silverlight Control)
_contextMenu.IsOpen = true; --> Error
ErrorMessage
errMsg "Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: Das Festlegen von Eigenschaft 'System.Windows.FrameworkElement.Style' hat eine Ausnahme ausgelöst."