2016-06-30 17 views
1

Windows IoTコアで動作するRaspberry Pi 3を使用してカスタムデバイスのペアリングを試みています。デバイスエニュメレーションとカスタムペアリング(シナリオ9​​)https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing/cs のgithubで提供されている公式サンプルは、ユーザーの操作が可能なローカルマシンで正常に動作します。カスタムペアリングのWindows iotコアで確認を提供する方法

しかし、Windowsのiotコアでそれを行う方法。でも、サンプルコードは、これは、デスクトップやモバイル上で実行されている場合

// Windows自体が「同意」の一環として、確認ダイアログをポップアップ表示されます言う

//これは、WindowsのIoTコア」のアプリケーションの場合'Windows Consent UXがない場合は、独自の確認を提供することができます。

private async void PairingRequestedHandler(
     DeviceInformationCustomPairing sender, 
     DevicePairingRequestedEventArgs args) 
    { 
     switch (args.PairingKind) 
     { 
      case DevicePairingKinds.ConfirmOnly: 
      // Windows itself will pop the confirmation dialog as part of "consent" 
      //if this is running on Desktop or Mobile 
      // If this is an App for 'Windows IoT Core' where there is no Windows 
      //Consent UX, you may want to provide your own confirmation. 

       args.Accept(); 
       break; 

どのように私は自分の確認を提供していますか?助けてください

答えて

1

確認はオプションで、システムレベルのユーザーエクスペリエンスの一部としてデスクトップとモバイルでのみ行われます。 Acceptメソッドを呼び出すと、ペアリングが進行します。

使用すると、確認のものを提供したい場合MessageDialogが現在のIoTコアではサポートされていないため、トリッキー取得:別の方法としてhttps://developer.microsoft.com/en-us/windows/iot/win10/unavailableapis

、他の人が経験を模倣するcreating your own UserControlまたはusing a Flyoutを提案しました。

0

Official IoTCoreDefaultAppはVisibilityプロパティを「Yes」および「No」に設定して動作を模倣しています。

enter image description here

https://github.com/ms-iot/samples/tree/develop/IoTCoreDefaultAppのサンプルコードをチェックしてください。

特に、https://github.com/ms-iot/samples/blob/develop/IoTCoreDefaultApp/IoTCoreDefaultApp/Views/Settings.xaml.csにライン536〜562から

private async void DisplayMessagePanel(string confirmationMessage, MessageType messageType) 

に気を付けます。

これはIoTアプリケーションで使用できるトリックです。

関連する問題