public async void StopProjecting()
        {
            broker.NotifyProjectionStopping();

            // There may be cases to end the projection from the projected view
            // (e.g. the presentation hosted in that view concludes)
            // broker.ProjectionViewPageControl.StartViewInUse();
            await this.player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
            {
                this.player.Stop();
                this.player.Source = null;

                broker.ProjectionViewPageControl.StartViewInUse();

                try
                {
                    await ProjectionManager.StopProjectingAsync(
                        broker.ProjectionViewPageControl.Id,
                        broker.MainViewId
                        );
                }
                catch { }
                Window.Current.Close();
            });

            broker.ProjectionViewPageControl.StopViewInUse();
        }
        private async void StopProjecting_Click(object sender, RoutedEventArgs e)
        {
            // There may be cases to end the projection from the projected view
            // (e.g. the presentation hosted in that view concludes)
            thisViewControl.StartViewInUse();
            await ProjectionManager.StopProjectingAsync(
                ApplicationView.GetForCurrentView().Id,
                mainViewId);

            thisViewControl.StopViewInUse();
        }
Ejemplo n.º 3
0
        private async void internalStopProjecting()
        {
            try
            {
                if (projecting)
                {
                    // There may be cases to end the projection from the projected view
                    // (e.g. the presentation hosted in that view concludes)
                    await ProjectionManager.StopProjectingAsync(externalViewId, ApplicationView.GetForCurrentView().Id);

                    projecting = false;
                }
            }
            catch (Exception ex)
            {   // this occurs when external screen was shut off - view id does not exist anymore.
                Debug.WriteLine("StopProjection: " + ex.Message);
            }
        }
Ejemplo n.º 4
0
 private async void StopProjecting_Click(object sender, RoutedEventArgs e)
 {
     // Only stop a presentation if one is already in progress
     if (rootPage.ProjectionViewPageControl != null)
     {  
         try
         {
             rootPage.ProjectionViewPageControl.StartViewInUse();
             // Note that as a result of making this call, the projection view will be "Consolidated"
             // ViewLifetimeControl, in turn, will close the view
             await ProjectionManager.StopProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId);
             rootPage.ProjectionViewPageControl.StopViewInUse();
         }
         catch (InvalidOperationException)
         {
             rootPage.NotifyUser("The projection view is being disposed", NotifyType.ErrorMessage);
         }
     }
     else
     {
         rootPage.NotifyUser("A presentation has not been started", NotifyType.ErrorMessage);
     }
 }
Ejemplo n.º 5
0
 public async Task StopProjection(int mainViewId)
 {
     await ProjectionManager.StopProjectingAsync(
         ApplicationView.GetForCurrentView().Id,
         mainViewId);
 }
Ejemplo n.º 6
0
 public async void StopProjection()
 {
     projectionBroker?.ProjectionViewPageControl?.StopViewInUse();
     await ProjectionManager.StopProjectingAsync(projectionBroker.ProjectionViewPageControl.Id, projectionBroker.MainViewId);
 }