Silverlight zoom area with canvas and scroll

I have a simple canvas with elements, and I need to add to view the scroll as a parent for my canvas. But I decided that after installation

canvas.RenderTransform=new ScaleTransform(){...}

Scroolbars is not displayed or is not working properly. We welcome any information.

+3
source share
1 answer

The transformation of the visualization occurs much later in the visualization of the user interface. Ultimately, it performs matrix transformation when rendering controls. The scroll viewer will be completely immune to this transformation, its scrollbars will be based on the unchanged size of the original canvas.

silverlight LayoutTransformer. .

: -

    <ScrollViewer Width="200" Height="200" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
        <toolkit:LayoutTransformer>
            <toolkit:LayoutTransformer.LayoutTransform>
                <ScaleTransform ScaleX="2" ScaleY="2" />
            </toolkit:LayoutTransformer.LayoutTransform>
            <Canvas Width="150" Height="150" Background="Aquamarine">
                <Rectangle Fill="Blue" Canvas.Top="10" Canvas.Left="10" Width="30" Height="30" />
            </Canvas>
        </toolkit:LayoutTransformer>
    </ScrollViewer>

Canvas (150) , (200), , (300). LayoutTransformer 300, . , ScrollViewer . LayoutTransformer ScrollViewer , Canvas 150, RenderTransform.

+7

Source: https://habr.com/ru/post/1791772/


All Articles