It looks like you want to achieve a smart geometry that is controlled by a control point. Currently you are gluing (attaching) the control point to a geometry vertex - when the vertex changes the control point location will also change. The following code example achieves the opposite - it has a control point, which when moved will move the first point of the shape geometry. You can expressions to achieve this result, please let us know if you would like the source code of any specific smart shape that comes with NOV Diagram for .NET
using System;
using System.Windows.Forms;
using Nevron.Nov;
using Nevron.Nov.Diagram;
using Nevron.Nov.Dom;
using Nevron.Nov.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
// Apply license for redistribution here. You can skip this code when evaluating NOV.
// NLicenseManager.Instance.SetLicense(new NLicense("LICENSE KEY"));
// Install NOV with diagram module
NModule[] modules = new NModule[] {
NDiagramModule.Instance
};
NNovApplicationInstaller.Install(modules);
}
private void Form1_Load(object sender, EventArgs e)
{
// clear all controls from the form
Controls.Clear();
// add a NOV widget inside the form
NDrawingView drawingView = new NDrawingView();
NNovWidgetHost<NDrawingView> host = new NNovWidgetHost<NDrawingView>(drawingView);
host.Dock = DockStyle.Fill;
Controls.Add(host);
// get the active page
NPage activePage = drawingView.Drawing.ActivePage;
NShape shape = new NShape();
activePage.Items.Add(shape);
shape.Init2DShape();
NControl control = new NControl();
control.Tooltip = "Move me to change the first point";
shape.Controls.Add(control);
NGeometry geomtry = shape.Geometry;
geomtry.MoveTo(new NBindingFx(control, NControl.XProperty), new NBindingFx(control, NControl.YProperty));
geomtry.LineTo(new NBindingFx(shape, NShape.WidthProperty), 0);
geomtry.LineTo(new NBindingFx(shape, NShape.WidthProperty), new NBindingFx(shape, NShape.HeightProperty));
geomtry.LineTo(0, new NBindingFx(shape, NShape.HeightProperty));
geomtry.CloseLastFigure = true;
shape.SetBounds(10, 10, 100, 100);
}
}
}
Best Regards,
Nevron Support Team