你需要将ApplicationViewBoundsMode
设置为UseCoreWindow
:
ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
默认值为ApplicationViewBoundsMode.UseVisible
,这是您当前的行为。使用ApplicationViewBoundsMode.UseCoreWindow
时,命令栏、状态栏和软件按钮都不会占用空间。
如果您需要在BoundsMode
更改时更改边距或其他内容,请注册VisibleBoundsChanged
事件:
ApplicationView.GetForCurrentView().VisibleBoundsChanged += OnVisibleBoundsChanged
您可以在官方文档中了解更多相关内容。