public static void OpenNowPlaying()
        {
            UiBlockerUtility.BlockNavigation();

            ModalSheetUtility.Show(CurrentSheet);

            App.SupressBackEvent += HardwareButtonsOnBackPressed;

            ScreenTimeoutHelper.OnNowPlayingOpened();
            Insights.Track("Opened Now Playing");
            IsActive = true;
        }
Пример #2
0
        public static async Task <T> ShowAsync <T>(IModalSheetPageAsync <T> sheet)
        {
            UiBlockerUtility.BlockNavigation();
            Show(sheet);
            Insights.Track("Opened " + sheet.GetType().Name);
            var results = await sheet.GetResultsAsync();

            Hide(sheet);
            Insights.Track("Closed " + typeof(T).Name);
            UiBlockerUtility.Unblock();
            return(results);
        }
Пример #3
0
        private void AddToMenuFlyoutItem_OnClick(object sender, RoutedEventArgs e)
        {
            UiBlockerUtility.BlockNavigation();
            var picker = new PlaylistPicker(_song)
            {
                Action = async playlist =>
                {
                    App.SupressBackEvent -= AppOnSupressBackEvent;
                    UiBlockerUtility.Unblock();
                    ModalSheetUtility.Hide();
                    await App.Locator.CollectionService.AddToPlaylistAsync(playlist, _song).ConfigureAwait(false);
                }
            };

            App.SupressBackEvent += AppOnSupressBackEvent;
            ModalSheetUtility.Show(picker);
        }
Пример #4
0
        private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            e.Handled = true;

            if (e.Message.Contains("No installed components were detected."))
            {
                // bug with Mvvmlight, hoping they get it fix soon.  Does not affect the app at all, no need to bug the user with it.
                // EDIT: seems to be another bug that happens with AdMediator also
                return;
            }

            DispatcherHelper.CheckBeginInvokeOnUI(
                async() =>
            {
                UiBlockerUtility.Unblock();
                await
                MessageBox.ShowAsync(
                    "There was a problem with the application. A crash report has been send automatically.",
                    "Crash prevented");
            });
        }
 private static void HardwareButtonsOnBackPressed(object sender, BackPressedEventArgs e)
 {
     UiBlockerUtility.Unblock();
     App.SupressBackEvent -= HardwareButtonsOnBackPressed;
     CloseNowPlaying();
 }
Пример #6
0
 private void AppOnSupressBackEvent(object sender, BackPressedEventArgs backPressedEventArgs)
 {
     App.SupressBackEvent -= AppOnSupressBackEvent;
     UiBlockerUtility.Unblock();
     ModalSheetUtility.Hide();
 }