System.Windows.Shapes.Line is working fine.
I went through your source code and am now able to delete the the physics object also. Below is the code:
this.Canvas.Children.Remove(this.Canvas.FindName(this.testLine.Name) as UIElement);
However i have a new problem of adding it back. Even though i add it through code like i did previously, its still not getting added as a physics object. Maybe some issue with Object Name. Still looking into this.
Is there any better way of doing this? I want to change the coordinates of the line and it should still behave like a physics object.
If i directly change the coordinates of the line, the UI line changes but an invisible physics line gets left behind at its previous position. Please help me.