Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 Windows 应用商店应用程序,根据应用程序是在纵向还是横向模式下运行,我获得了不同的背景图像资产。
除此背景图像外,没有其他特定方向的差异。
实现此要求的最整洁的方法是什么?
您可以在Window.Current.SizeChanged处理程序中设置它:
Window.Current.SizeChanged
Window.Current.SizeChanged += (sender, args) => { if (ApplicationView.Value == ApplicationViewState.FullScreenLandscape) { // ... } else if (ApplicationView.Value == ApplicationViewState.FullScreenPortrait) { // ... } };