Guys I am using a canvas as a ItemsPanelTemplate and binding it to a line list which contains typical line start points and end points
<ItemsControl ItemsSource="{Binding Path = LineList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
Now. I would like to move the center point to middle of the canvas instead of top left corner.There are few option in front of me
- Using value converters and adjust the value based on the canvas size and display [adjust x and y values]
- Transform the canvas as mention in following posts: How to change x,y origin of canvas...? and Ray's answer
I know how to do it through first method, but when I tried through second method it is not changing the coordinate system. Why is that? I just substituted the answer in my code as below. Am I missing something?
****Update**** : Following code works correctly
<ItemsControl ItemsSource="{Binding Path = LineList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas>
<Canvas.LayoutTransform>
<ScaleTransform ScaleX="1" ScaleY="-1" CenterX=".5" CenterY=".5" />
</Canvas.LayoutTransform>
</Canvas>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>