How to change x,y origin of canvas to bottom left and flip the y coordinates? How to change x,y origin of canvas to bottom left and flip the y coordinates? wpf wpf

How to change x,y origin of canvas to bottom left and flip the y coordinates?


<Canvas>    <Canvas.LayoutTransform>        <ScaleTransform ScaleX="1" ScaleY="-1" CenterX=".5" CenterY=".5" />    </Canvas.LayoutTransform></Canvas>


I tried the ScaleTransform method extensively: It does not work. It only shifts one of the 2 coordinates, never both. This, however, works as advertised:

<Canvas Name="myCanvas" Width="0" Height="0" RenderTransform="1 0 0 -1 0 0"    HorizontalAlignment="Center" VerticalAlignment="Center" >


If you use databinding you can use a TypeConvertor, but for that you have to go outside the XAML and you need to know the size of the canvas beforehand.