I am not familiar with UWP but i found this example.
It creates a smartcard reader instance:
private SmartCardReader reader = provisioning.SmartCard.Reader;
and adds a CardAdded
handler to it:
reader.CardAdded += HandleCardAdded;
The HandlerCardAdded
looks like this:
void HandleCardAdded(SmartCardReader sender, CardAddedEventArgs args)
{
// This event handler will not be invoked on the UI thread. Hence,
// to perform UI operations we need to post a lambda to be executed
// back on the UI thread; otherwise we may access objects which
// are not marshalled for the current thread, which will result in an
// exception due to RPC_E_WRONG_THREAD.
uiContext.Post((object ignore) =>
{
rootPage.NotifyUser("Card added to reader " + reader.Name + ".", NotifyType.StatusMessage);
}, null);
}
Hope this helps you a little.