Share via


TransferTargetChangedEventArgs.Target Property

Definition

The Target property gets the transfer target associated with the event. This property provides details about the target that was added, removed, or updated.

public:
 property TransferTarget ^ Target { TransferTarget ^ get(); };
/// [Windows.Foundation.Metadata.Experimental]
/// [get: Windows.Foundation.Metadata.Experimental]
TransferTarget Target();
[Windows.Foundation.Metadata.Experimental]
public TransferTarget Target { [Windows.Foundation.Metadata.Experimental] get; }
var transferTarget = transferTargetChangedEventArgs.target;
Public ReadOnly Property Target As TransferTarget

Property Value

A TransferTarget object that represents the transfer target associated with the event.

Attributes

Examples

Example: Accessing the Target in an Event Handler

watcher.Added += (sender, args) =>
{
    var target = args.Target;
    Console.WriteLine($"New target added: {target.Label}");
};

Remarks

The Target property is used in event handlers for TransferTargetWatcher events such as Added, Removed, and Updated. It provides access to the transfer target that triggered the event.

Usage Notes:

  • Use the Target property to retrieve details about the transfer target involved in the event.
  • The Target object contains additional properties such as Id, Label, and IsEnabled.

Applies to

See also