hi dear supporters,
i have used the connection content and connection points to route the connection.
now, the connection content is positioned in the middle of the connection but i need to position it in other positions.
the image is attached.
my code is also here.
how can i get the needed position of the connection content.
private void diagram1_ConnectionManipulationCompleted(object sender, ManipulationRoutedEventArgs e)
{
var image = new System.Windows.Controls.Image() { Source = new BitmapImage(new Uri("components/" + "conn"+ ".png",UriKind.Relative)) };
System.Windows.Point startPoint= e.Connection.StartPoint;
System.Windows.Point endPoint= e.Connection.EndPoint;
double deltaX = Math.Abs(endPoint.X - startPoint.X);
double deltaY = Math.Abs(endPoint.Y - startPoint.Y);
image.Stretch=Stretch.Fill;
image.Width = 0.8*Math.Max(deltaX,deltaY);
image.Height = 5;
TextBlock txt = new TextBlock();
txt.Text = strSelectedComponent;
StackPanel stpanel = new StackPanel();
stpanel.Children.Add(txt);
stpanel.Children.Add(image);
Viewbox viewBox = new Viewbox() { Stretch = Stretch.None, Margin = new Thickness(-4) };
viewBox.Child = stpanel;
e.Connection.ConnectionPoints.Add(new System.Windows.Point(endPoint.X,startPoint.Y));
e.Connection.Content = viewBox;
}