Snap上的Windows Metro SizedChange

时间:2013-10-21 11:34:19

标签: c# windows-8 windows-8.1

当用户尝试在左侧网站上捕捉视图/应用时,我的图像和画布很麻烦。我已经在

上声明了一个方法和一个委托
 Window.Current.SizeChanged += OnWindowSizeChanged; 

但这并不酷,因为我已经有了一个pinchZoom。当AppWindow调整大小时,我真的不希望缩小视图。是否有任何参数可以设置视图未在该事件上调整大小?

 <Grid Height="758" Grid.RowSpan="2"  Width="10000" ManipulationMode="All" x:Name="paper" PointerWheelChanged="scrolled" ManipulationDelta="PaperManipulation" >
            <Grid.RenderTransform>
                <CompositeTransform></CompositeTransform>
            </Grid.RenderTransform>


            <Image Source="images/page.png" x:Name="backgroundpaper"  HorizontalAlignment="Left" Height="758" Width="10000" Margin="10,0,0,0" VerticalAlignment="Top" />

            <Grid Margin="240,140,0,0"  Height="600" x:Name="canvases" ManipulationMode="All" VerticalAlignment="Center">
                <Grid.RenderTransform>
                    <CompositeTransform></CompositeTransform>
                </Grid.RenderTransform>

                <Canvas    Tapped="canvasTapped" Background="Transparent" ManipulationMode="All" RenderTransformOrigin="0.5, 0.5" x:Name="background_canvas" Height="600"  VerticalAlignment="Top" Width="600" HorizontalAlignment="Left">

                </Canvas>

               .... // SOME MORE ELEMENTS
            </Grid>
        </Grid>

到目前为止,谢谢。

1 个答案:

答案 0 :(得分:1)

您可以在XAML中查看您的代码吗? 我想你在那里设置了一些宽度。

  <VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="ApplicationViewStates">
        <VisualState x:Name="Snapped">
            <Storyboard>
                //check your code here in snapped view handling
            </Storyboard>
        </VisualState>
    </VisualStateGroup>
  </VisualStateManager.VisualStateGroups>