private void Window_Closed(object sender, EventArgs e) { if (nfcHandler != null) { nfcHandler.Dispose(); nfcHandler = null; } }