ContactRemovedEventArgs ContactRemovedEventArgs ContactRemovedEventArgs ContactRemovedEventArgs ContactRemovedEventArgs Class

Definition

Contains info about a removed contact. Returned when a ContactRemoved event occurs.

public : sealed class ContactRemovedEventArgs : IContactRemovedEventArgs
struct winrt::Windows::ApplicationModel::Contacts::Provider::ContactRemovedEventArgs : IContactRemovedEventArgs
public sealed class ContactRemovedEventArgs : IContactRemovedEventArgs
Public NotInheritable Class ContactRemovedEventArgs Implements IContactRemovedEventArgs
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

Remarks

Your app gets a ContactRemovedEventArgs object when the ContactRemoved event occurs.

Properties

Id Id Id Id Id

Contains a unique identifier for the contact.

public : Platform::String Id { get; }
winrt::hstring Id();
public string Id { get; }
Public ReadOnly Property Id As string
var string = contactRemovedEventArgs.id;
Value
string string string

A unique identifier for the contact.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

Examples

The following example shows one way to use the Id property of the ContactRemovedEventArgs class.

function onContactRemovedFromBasket(e) {
    var removedContactDiv = document.createElement("div");
    removedContactDiv.innerText = "Contact ID: " + e.id + " has been removed.";
    document.body.appendChild(removedContactDiv);
}

Remarks

When you work with contacts, you must supply an ID property for each contact. The value of this property can be whatever makes the most sense for your app, but it must enable you to uniquely identify each contact. Actions like removing a contact depend on this ID value to ensure that the correct contact is removed. For a complete example, see our code sample.