Hi Bork,
The following Code snippet will help you in getting the nodes inside the "Defined Polygon" to be at front and the Polygon will be set back.
Inside the NodeCollectionChanged event handler, please type the below code snippet:
******
void EventSink_NodeCollectionChanged(CollectionExEventArgs evtArgs)
{
if (evtArgs.ChangeType == CollectionExChangeType.Insert)
{
if (evtArgs.Element is Polygon)
{
Polygon t_polygon = (Polygon)evtArgs.Element;
this.diagramComponent.Model.SendToBack(t_polygon);
this.diagramComponent.Controller.SelectionList.Add(t_polygon);
foreach (Node node in this.diagramComponent.Model.Nodes)
{
if ((node.BoundingRectangle.X >= t_polygon.BoundingRectangle.X) && (t_polygon.BoundingRectangle.Bottom >= node.BoundingRectangle.Bottom))
{
this.diagramComponent.Model.BringForward(node);
this.diagramComponent.Controller.SelectionList.Add(node);
}
}
}
this.diagramComponent.Refresh();
}
}
******
Let me know if you shall need any further clarifications in this regard.
Happy Coding!
- Ajeet
>Actually when user releases mouse button, system creates new polygon (polyline points are served as polygon points). However I do not know how to get the nodes which are located within that polygon or inside the polyline. If I will be able to get these nodes I will group them together with a polygon or whatever and accomplish what I wanted
Attached you will find a few screenshots which demonstrate what exactly I wanted
CustomArea_208d280c.zip