コード例 #1
0
        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
ファイル: App.xaml.cs プロジェクト: dbeattie71/Audiotica
        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");
            });
        }
コード例 #5
0
 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();
 }