I am trying to bind data to this ItemsControl :
<ItemsControl ItemsSource="{Binding Path=Nodes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl>
Using this DataTemplate , I am trying to individually position my Node elements in Canvas correctly:
<DataTemplate DataType="{x:Type Model:EndNode}"> <Controls:EndNodeControl Canvas.Left="{Binding Path=XPos}" Canvas.Top="{Binding Path=YPos}" /> </DataTemplate>
However, it does not work as expected. All my node elements are drawn one above the other in the same position. Any suggestions on how to do this?
c # wpf canvas itemscontrol
atsjoo Aug 12 '09 at 10:22 2009-08-12 10:22
source share