Windows 8.0 코드가 있고 Portrait, Landscape, filled and Snapped와 같은 ViewStates UI를 처리했습니다. 그러나 Windows 8.1에서는 뷰어가 앱을 어떤 크기로도 이동할 수 있습니다. 이 경우 UI를 어떻게 처리해야합니까? 현재 나는 이것을 이렇게하고있다. 이 윈도우의 크기와 화면 비율에 의존하게 - 대신 ApplicationViewState
에 레이아웃을 내놓고의Windows 8.1 저장소 응용 프로그램에서 다양한보기 상태를 처리하는 방법
private void QuestionPage_SizeChanged(object sender, SizeChangedEventArgs e)
{
ApplicationViewState currentState = Windows.UI.ViewManagement.ApplicationView.Value;
if (currentState.Equals(ApplicationViewState.Snapped))
{
VisualStateManager.GoToState(this, "Snapped", false);
}
else if (currentState.Equals(ApplicationViewState.FullScreenLandscape))
{
VisualStateManager.GoToState(this, "FullScreenLandscape", false);
}
else if (currentState.Equals(ApplicationViewState.Filled))
{
VisualStateManager.GoToState(this, "Filled", false);
}
else if (currentState.Equals(ApplicationViewState.FullScreenPortrait))
{
VisualStateManager.GoToState(this, "FullScreenPortrait", false);
}
}