BarcodeScannerPreviewActivatedEventArgs.ConnectionId Property

Definition

Gets a connection ID used to match the service connection.

public:
 property Platform::String ^ ConnectionId { Platform::String ^ get(); };
winrt::hstring ConnectionId();
public string ConnectionId { get; }
var string = barcodeScannerPreviewActivatedEventArgs.connectionId;
Public ReadOnly Property ConnectionId As String

Property Value

String

Platform::String

winrt::hstring

A connection ID.

Implements

Examples

This example gets a connction ID from an activated argument, and then uses it to start the video preview page.

protected override async void OnActivated(IActivatedEventArgs args)
{
    base.OnActivated(args);

    if (args.Kind == ActivationKind.BarcodeScannerProvider)
    {
        ... // Create and activate root frame. 

        var eventArgs = args as BarcodeScannerPreviewActivatedEventArgs;
        string connectionId = eventArgs.ConnectionId;

        BarcodeScannerProviderConnection connection = _taskList.GetConnection(connectionId);
        if (connection != null)
        {
            var page = rootFrame.Content as MainPage;
            if (page != null)
            {
                await page.StartVideoPreview(connection);
            }
        }
    }
}


Applies to