I'm trying to disable moving a child shape of a RadDiagramContainerShape by override DraggingService as below:
public
class
MyDragging : DraggingService
{
private
readonly
RadDiagram diagram;
public
MyDragging(RadDiagram graph)
:
base
(graph
as
IGraphInternal)
{
this
.diagram = graph;
}
public
override
void
Drag(Point newPoint)
{
if
(
this
.DraggingModels.FirstOrDefault().ParentContainer !=
null
)
{
return
;
}
else
{
base
.Drag(newPoint);
}
}
}
It does make the child shape immovable. However, after I dragged the child shape, it will be removed from the parent container shape. (subShape.ParentContainer will be null). Then, when I drag the child shape again, it can be moved.
How to fix this issue?