首页 > 解决方案 > 有没有办法在使用“RequestStartCasting”的 Miracast 设备期间隐藏配对消息框?

问题描述

  1. 在显示监视器中连接 Miracast 设备
  2. 使用“CastingDevice.CreateCastingConnection()”创建与 Miracast 设备的连接
  3. 使用“castDeviceConnection.RequestStartCastingAsync()”使用 Miracast 设备进行投射请求

调用“RequestStartCastingAsync()”后显示设备配对消息框。有没有办法隐藏这些消息框?

示例代码:

            //Create a new casting connection to the device that's been selected
             castDeviceConnection = SelectedCastingDevice.CreateCastingConnection();

            //Register for events
            castDeviceConnection.ErrorOccurred += Connection_ErrorOccurred;
            castDeviceConnection.StateChanged  += Connection_StateChanged;

            //casting test image
            Image castImage = new Image();
            castImage.Source = new Windows.UI.Xaml.Media.Imaging.BitmapImage
                                                        (new Uri(@"ms-appx:////Assets/test.jpg"));
            CastingConnectionErrorStatus status = CastingConnectionErrorStatus.Unknown;

            // Request for casting
            castDeviceConnection.RequestStartCastingAsync( castImage.GetAsCastingSource());

标签: c#uwpmiracast

解决方案


推荐阅读