如何在Win 8應用程序中使用「快照視圖」過程?Windows 8中的快照視圖解決方案
我已經嘗試了許多次使用不同的博客,但無法找到正確的解決方案。
誰能幫我具備以下條件:
- 什麼是快照視圖編碼?
- 如何實現這個?
我提出了申請,但卡在了「Snap View」。
在此先感謝。
如何在Win 8應用程序中使用「快照視圖」過程?Windows 8中的快照視圖解決方案
我已經嘗試了許多次使用不同的博客,但無法找到正確的解決方案。
誰能幫我具備以下條件:
我提出了申請,但卡在了「Snap View」。
在此先感謝。
SnapView是一個內置的Windows功能。
只要您的用戶的屏幕分辨率至少達到1366乘768,他們就能夠激活快照視圖。
SnapView很容易實現。像後退按鈕和頁面標題的默認東西已經實現,但您也可以將自定義元素添加到列表中。
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton"
Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{StaticResource SnappedBackButtonStyle}" />
</ObjectAnimationUsingKeyFrames>
讓我們從上面的代碼工作:
Storyboard.TargetName="backButton"
所以我們所做的只是,backButton
將Style
財產更改爲{StaticResource SnappedBackButtonStyle}
。
您可以對任何其他元素執行相同操作。
下面是從文件代碼:
<!-- Visual states reflect the application's view state -->
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="FullScreenLandscape" />
<VisualState x:Name="Filled" />
<!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
<VisualState x:Name="FullScreenPortrait">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton"
Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<!-- The back button and title have different styles when snapped -->
<VisualState x:Name="Snapped">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton"
Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle"
Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
這是我找到固定卡視圖問題最簡單的答案http://rushabh.greenpoison.org.in/blog/2012/09/18 /處理-卡扣視圖和 - 全分辨率 - 在窗口-8 / – cjds