Windows 8.1平板电脑上的屏幕镜像问题

时间:2014-11-25 02:34:47

标签: c# windows xaml windows-8.1 miracast

我正在尝试使用适用于Windows 8.1平板电脑的wifi加密狗在电视上实现屏幕镜像。我使用了microsoft提供的projectionmanager类,但由于某种原因它无法检测到辅助显示。以下是代码:

 bool available = ProjectionManager.ProjectionDisplayAvailable;

 ProjectionManager.ProjectionDisplayAvailableChanged += (s, e) =>
 {
       available = ProjectionManager.ProjectionDisplayAvailable;
 };

 int thisviewid = ApplicationView.GetForCurrentView().Id;
 // CoreDispatcher preseDispatcher= await ((App)App.Current).CreateNewView;
 ApplicationView appView = ApplicationView.GetForCurrentView();

 CoreApplicationView view = CoreApplication.CreateNewView();
 ApplicationView newAppView = ApplicationView.GetForCurrentView();
 await view.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,() =>
      {
          Window newWindow = Window.Current;

          var rootframe = new Frame();
          rootframe.Navigate(typeof(Projection),null);
          Window.Current.Content = rootframe;
      }
 ); 
 await ProjectionManager.StartProjectingAsync(newAppView.Id, appView.Id);

当我调试代码时,ProjectionsDisplayAvailable值仍为false。不确定如何继续进行或使其正常工作

0 个答案:

没有答案