[英]How to bind a property on App.xaml.cs on all pages of universal app / Windows 8.1 and Windows Phone?
[英]Hiding the status bar on all pages in a Windows Phone 8.1 App
我可以隱藏每個頁面上的狀態欄,但是是否有一種更簡單的方法可以在一個地方進行此操作?
進入您的App.xaml.cs文件,並在OnLaunched
添加此文件
StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
// Hide the status bar
await statusBar.HideAsync();
您可以將其隱藏在OnLaunched
事件處理程序的App.xaml.cs中。 為了避免向OnLaunched
方法添加async
,可以使用Task
Wait()
方法:
StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
// Hide the status bar
Task hidingStatusBarTask = statusBar.HideAsync();
hidingStatusBarTask.Wait();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.