BarcodeScannerPreviewActivatedEventArgs.ConnectionId 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.
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
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);
}
}
}
}