This question is locked. New answers and comments are not allowed.
Hello,
we have inherited our own controlset from the Telerik Rad-controls, so that we can extend them on demand with custom functionality.
Everything works perfect, but we have a small issue with the context menu.
It works on runtime, but on designtime it destroys our xaml previews, so that we have no previews anymore.
The function GetContextMenu() seems to lead to a null exception in the xaml.
So, my question is, what are we doing wrong, and what is the correct way to inherit from RadContextMenu.
Regards,
BDL
namespace
Bdl.DialogCrm.Silverlight.Core.BDLControls
{
using
System.Linq;
using
Bdl.DialogCrm.Silverlight.Core.ViewManagement;
using
Telerik.Windows.Controls;
public
class
BDLContextMenue : RadContextMenu
{
public
BDLContextMenue()
{
}
public
static
new
BDLContextMenue GetContextMenu(System.Windows.FrameworkElement element)
{
if
(RadContextMenu.GetContextMenu(element)
is
BDLContextMenue)
{
return
(BDLContextMenue)RadContextMenu.GetContextMenu(element);
}
else
{
return
null
;
}
}
public
bool
HasMenuItem(BDLMenuItem item)
{
if
(
this
.Items.Any(x => ((x
is
BDLMenuItem) && ((x
as
BDLMenuItem) == item))))
{
return
true
;
}
else
{
return
false
;
}
}
}
}