C#Universal App Canvas对象比Scrollview更大

时间:2015-03-04 07:42:53

标签: c# scrollview zoom win-universal-app pinchzoom

        <ScrollViewer x:Name="scrview"
                        ZoomMode="Enabled" 
                      VerticalAlignment="Top" 
                      HorizontalAlignment="Left" 
                      Margin="50,50,0,0"
                      Height="400" Width="1000" 
                      BorderBrush="AliceBlue" 
                      BorderThickness="2"
                      ManipulationMode="All"
                      HorizontalScrollBarVisibility="Disabled"
                      VerticalScrollBarVisibility="Disabled"
                      MinZoomFactor="2"
                      MaxZoomFactor="5000"
                      DoubleTapped="ScrollViewer_DoubleTapped">
                <Canvas x:Name="recGrid" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
        </ScrollViewer>

我有一个画布对象,其中包含Rectangles.Become创建此画布,它将比Scrollview更大。我尝试缩小以查看所有Rectangels但它无法正常工作。我可以放大但不能缩小。

有人有想法吗?

提前谢谢

1 个答案:

答案 0 :(得分:0)

        <ScrollViewer x:Name="scrview"
                        ZoomMode="Enabled" 
                      VerticalAlignment="Top" 
                      HorizontalAlignment="Left" 
                      Margin="50,50,0,0"
                      Height="400" Width="1000" 
                      BorderBrush="AliceBlue" 
                      BorderThickness="2"
                      ManipulationMode="All"
                      HorizontalScrollBarVisibility="Disabled"
                      VerticalScrollBarVisibility="Disabled"
                      MinZoomFactor="2"
                      MaxZoomFactor="5000"
                      DoubleTapped="ScrollViewer_DoubleTapped">
                <Canvas x:Name="recGrid" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
        </ScrollViewer>