Share via


TransferTargetChangedEventArgs Class

Definition

The TransferTargetChangedEventArgs class provides data for events that notify applications about changes to a transfer target, such as when a target is added, removed, or updated.

public ref class TransferTargetChangedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 1245184)]
/// [Windows.Foundation.Metadata.Experimental]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class TransferTargetChangedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 1245184)]
[Windows.Foundation.Metadata.Experimental]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class TransferTargetChangedEventArgs
Public NotInheritable Class TransferTargetChangedEventArgs
Inheritance
Object Platform::Object IInspectable TransferTargetChangedEventArgs
Attributes

Windows requirements

Requirements Description
Device family
Windows 11, version 24H2 (introduced in 10.0.26100.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v19.0)

Examples

Example: Handling TransferTargetWatcher Events

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

watcher.Updated += (sender, args) =>
{
    Console.WriteLine($"Target updated: {args.Target.Label}");
};

watcher.Removed += (sender, args) =>
{
    Console.WriteLine($"Target removed: {args.Target.Label}");
};

Remarks

This class is used in conjunction with the TransferTargetWatcher to deliver detailed information about transfer target changes. It allows applications to respond dynamically to updates in the available transfer targets.

Key Properties:

  • Target: Gets the transfer target associated with the event.

Usage:

This class is typically used in event handlers for the Added, Removed, and Updated events of the TransferTargetWatcher.

Properties

Name Description
Target

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

Applies to

See also