Rotate the canvas should not rotate it

Is there a way to rotate only the canvas without rotating it like images, geometry, etc.? Any help that anyone can provide is commendable.

Thanks a lot

+2
source share
3 answers

The Kent Boogarts proposal is something that I was thinking about initially too, it’s not even so difficult to implement, since you can directly relate to the InverseCanvas transformation :

<ItemsControl>
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <Canvas>
                <Canvas.RenderTransform>
                    <RotateTransform />
                </Canvas.RenderTransform>
            </Canvas>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <ContentControl Content="{Binding}"
                            RenderTransform="{Binding RelativeSource={RelativeSource AncestorType=Canvas},
                                                      Path=RenderTransform.Inverse}"/>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>
+3
source

I think the only way is to rotate Canvasand rotate it in a different direction.

+2
source

No, there is no way to do this unless you apply the opposite transformation to each child. Perhaps if you explain what you are trying to achieve, most likely it will be an easier way to do this.

0
source

All Articles