Windows runtime 如何在Windows应用商店应用程序中设置特定于方向的背景?

Windows runtime 如何在Windows应用商店应用程序中设置特定于方向的背景?,windows-runtime,windows-store-apps,winrt-xaml,Windows Runtime,Windows Store Apps,Winrt Xaml,我有一个Windows应用商店应用程序,根据应用程序是以纵向模式还是横向模式运行,为我提供了不同的背景图像资源 除此背景图像外,没有其他特定于方向的差异 实现此要求的最整洁的方法是什么?您可以在窗口中设置它。Current.SizeChanged处理程序: Window.Current.SizeChanged += (sender, args) => { if (ApplicationView.Value == ApplicationViewState.FullScreenLand

我有一个Windows应用商店应用程序,根据应用程序是以纵向模式还是横向模式运行,为我提供了不同的背景图像资源

除此背景图像外,没有其他特定于方向的差异


实现此要求的最整洁的方法是什么?

您可以在
窗口中设置它。Current.SizeChanged
处理程序:

Window.Current.SizeChanged += (sender, args) =>
{
    if (ApplicationView.Value == ApplicationViewState.FullScreenLandscape)
    {
        // ...
    }
    else if (ApplicationView.Value == ApplicationViewState.FullScreenPortrait)
    {
        // ...
    }
};