示例#1
0
        /// <summary>
        /// Shows the status bar.
        /// </summary>
        /// <returns></returns>
        public Task ShowAsync()
        {
#if WINDOWS_UWP || WINDOWS_PHONE_APP
            if (_statusBar != null)
            {
                return(_statusBar.ShowAsync().AsTask());
            }
#elif WINDOWS_PHONE
            return(Task.Run(() => { Microsoft.Phone.Shell.SystemTray.IsVisible = true; }));
#endif
            return(Task.Run(() => { }));
        }
示例#2
0
        /// <summary>
        /// Tries to display the status bar
        /// </summary>
        /// <returns>The occluded height if the operation succedes</returns>
        public static async Task <double> TryShowAsync()
        {
            StatusBar statusBar = GetCurrentStatusBarAsync();

            if (statusBar == null)
            {
                return(0);
            }
            statusBar.BackgroundColor = null;
            await statusBar.ShowAsync();

            return(statusBar.OccludedRect.Height);
        }