WPF Canvas Scaling/Transform to Fit
As your Canvas
doesn't seem to have fixed width and height, I would include it into a Viewbox
:
<ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Viewbox Stretch="Uniform"> <Canvas x:Name="canvas" Background="DarkSeaGreen"> <Canvas.LayoutTransform> <ScaleTransform ScaleY="-1" /> </Canvas.LayoutTransform> </Canvas> </Viewbox> </ItemsPanelTemplate></ItemsControl.ItemsPanel>
Alternatively, place your entire UserControl
into a ViewBox
.