캔버스에 일부 선을 표시하려고합니다.이 선들은 Y 축 위치가 다르므로 itemscontrol을 작성하고 Y 값과 선에 표시 할 텍스트가있는 사전에 바인딩됩니다.목록보기의 행에 대한 참조 점
내 문제는 개별 항목의 원점을 기준으로 (x1, y1) (x2, y2) 점에 선이 표시되지만 각 선이 캔버스 원점에서 Y 축 거리를 가지게하는 것입니다.
<Canvas Margin="0,8,0,8" Height="374" Width="150" >
<ItemsControl ItemsSource="{Binding Path=YPointsDictionary Margin="0">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Line X1="0" Y1="{Binding Value}" X2="150" Y2="{Binding Value}"
StrokeThickness="2" Stroke="Yellow" StrokeDashArray="2,2" />
<Label Content="{Binding Key}" Foreground="Yellow" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Canvas>