TransferTargetChangedEventArgs.Target Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Targetproperty to retrieve details about the transfer target involved in the event. - The
Targetobject contains additional properties such asId,Label, andIsEnabled.