2012-07-16 120 views
1

從CP更改爲RP窗口8後,我無法再使用我的快照視圖。任何人都知道這個問題?看起來像VirtualState沒有迴應升級後無法捕捉窗口8

<Page x:Name="pageRoot" 
    x:Class="World_Clock.MainPage" 
    IsTabStop="false" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="using:World_Clock" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d"> 

    <Viewbox x:Name="viewbox" HorizontalAlignment="Left" Height="auto" VerticalAlignment="Top" Width="auto" Stretch="UniformToFill"> 

     <ScrollViewer HorizontalAlignment="Left" Height="764" VerticalAlignment="Top" Width="1353" VerticalScrollMode="Disabled" IsVerticalRailEnabled="False"> 

      <Grid x:Name="maingrid" Height="auto" Width="auto"> 
       <Grid.Background> 
        <ImageBrush ImageSource="Assets/wp2.png" Stretch="UniformToFill"/> 
       </Grid.Background> 
       <Rectangle HorizontalAlignment="Left" Height="134" Margin="1025,358,0,0" VerticalAlignment="Top" Width="204" Fill="#FFCCE1CC"/> 
       etc... 
       </Grid> 
<Image x:Name="image" HorizontalAlignment="Left" Height="768" VerticalAlignment="Top" Width="324" Source="Assets/Logo.png" Stretch="UniformToFill" Grid.RowSpan="2" Margin="1464,0,-422,0"/> 

      </Grid> 

     </ScrollViewer> 
    </Viewbox> 

<VisualStateManager.VisualStateGroups> 
     <VisualStateGroup x:Name="ApplicationViewStates"> 
      <VisualState x:Name="Portrait"> 
       <Storyboard> 
        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grid1" Storyboard.TargetProperty="Margin"> 
         <DiscreteObjectKeyFrame KeyTime="0" Value="70,500,0,0"/> 
        </ObjectAnimationUsingKeyFrames> 
        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grid2" Storyboard.TargetProperty="Margin"> 
         <DiscreteObjectKeyFrame KeyTime="0" Value="48,900,0,-164"/> 
        </ObjectAnimationUsingKeyFrames> 
       </Storyboard> 
      </VisualState> 

<VisualState x:Name="Snapped"> 
        <Storyboard> 
         <ObjectAnimationUsingKeyFrames Storyboard.TargetName="image" Storyboard.TargetProperty="Margin"> 
          <DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,0"/> 
         </ObjectAnimationUsingKeyFrames> 
        </Storyboard> 
       </VisualState> 
     </VisualStateGroup> 

    </VisualStateManager.VisualStateGroups> 


</Page> 

回答

4

好消息!

測試你的XAML和應用程序snapps

<Page 
x:Class="App4.MainPage" 
IsTabStop="false" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:App4" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d"> 

<Viewbox x:Name="viewbox" HorizontalAlignment="Left" Height="auto" VerticalAlignment="Top" Width="auto" Stretch="UniformToFill"> 
    <ScrollViewer HorizontalAlignment="Left" Height="764" VerticalAlignment="Top" Width="1353" VerticalScrollMode="Disabled" IsVerticalRailEnabled="False"> 
     <Grid x:Name="maingrid" Height="auto" Width="auto" Background="white"> 
      <Rectangle HorizontalAlignment="Left" Height="134" Margin="1025,358,0,0" VerticalAlignment="Top" Width="204" Fill="#FFCCE1CC"/> 
     </Grid> 
    </ScrollViewer> 
</Viewbox> 

<VisualStateManager.VisualStateGroups> 
    <VisualStateGroup x:Name="ApplicationViewStates"> 
     <VisualState x:Name="Portrait"> 
      <Storyboard> 
       <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grid1" Storyboard.TargetProperty="Margin"> 
        <DiscreteObjectKeyFrame KeyTime="0" Value="70,500,0,0"/> 
       </ObjectAnimationUsingKeyFrames> 
       <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grid2" Storyboard.TargetProperty="Margin"> 
        <DiscreteObjectKeyFrame KeyTime="0" Value="48,900,0,-164"/> 
       </ObjectAnimationUsingKeyFrames> 
      </Storyboard> 
     </VisualState> 

     <VisualState x:Name="Snapped"> 
      <Storyboard> 
       <ObjectAnimationUsingKeyFrames Storyboard.TargetName="image" Storyboard.TargetProperty="Margin"> 
        <DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,0"/> 
       </ObjectAnimationUsingKeyFrames> 
      </Storyboard> 
     </VisualState> 
    </VisualStateGroup> 
</VisualStateManager.VisualStateGroups> 

它可以是你在一個過低的分辨率運行?檢查分辨率,貼片功能在1366以下無法正常工作我相信。

祝你好運!讓我知道它是怎麼回事,問題是什麼!

+0

其中我不得不把代碼放在網格標籤內才能使用!不管怎麼說,還是要謝謝你 – CodeGuru 2012-07-20 00:54:48