我可以在应用程序被捕捉时使用ContactPicker合约吗?
var picker = new Windows.ApplicationModel.Contacts.ContactPicker();
picker.CommitButtonText = "Select";
picker.SelectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.Fields;
picker.DesiredFields.Add(Windows.ApplicationModel.Contacts.KnownContactField.Email);
var contactInformation = await picker.PickSingleContactAsync();
上面的代码在全屏时有效,但在捕捉到屏幕一侧时在调用 PickSingleContactAsync() 时会引发以下异常:
System.Runtime.InteropServices.COMException 未被用户代码处理
H结果=-2147467259
Message=Error HRESULT E_FAIL 已从对 COM 组件的调用中返回。
源=mscorlib
错误代码=-2147467259
StackTrace:在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)在 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 在 TouchToneDtmf.MainPage.d__e .MoveNext() 在 d:\Users\Foo\MainPage.xaml.cs:line 556 InnerException: