ContactPanelActivatedEventArgs.Contact 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從連絡人面板取得選取的連絡人。
public:
property Contact ^ Contact { Contact ^ get(); };
Contact Contact();
public Contact Contact { get; }
var contact = contactPanelActivatedEventArgs.contact;
Public ReadOnly Property Contact As Contact
屬性值
選取的連絡人。
實作
範例
protected async override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.ContactPanel)
{
// At this point, ContactPanelActivatedEventArgs.Contact
// is an empty Contact. Only its Id property is set.
ContactPanelActivatedEventArgs panelArgs = (ContactPanelActivatedEventArgs)args;
// To get access to all of the Contact's property data, you must
// use the Id to re-retrieve the Contact from the ContactStore.
ContactStore store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite);
Contact contact = await store.GetContactAsync(panelArgs.Contact.Id);
// Now you have a fully populated Contact to work with.
}
}
備註
選取的連絡人將會是空的連絡人,只有其 Id 屬性集。 您必須使用此識別碼從 ContactStore 重新擷取連絡人,才能存取連絡人的其餘屬性資料。