I am new in WPF, need to bind a line to 2 dots.
But the code bellow does not work:
<Canvas>
<Ellipse x:Name="dot1" Width="5" Height="5"
Canvas.Left="50" Canvas.Top="50"/>
<Ellipse x:Name="dot2" Width="5" Height="5"
Canvas.Left="100" Canvas.Top="100"/>
<Line
X1="{Binding ElementName='dot1', Path='Canvas.Left'}"
Y1="{Binding ElementName='dot1', Path='Canvas.Top'}"
X2="{Binding ElementName='dot2', Path='Canvas.Left'}"
Y2="{Binding ElementName='dot2', Path='Canvas.Top'}"/>
</Canvas>
Where is the error? Thanks!