Im creating an attendance sign-in application which allows students to sign in by tapping their card on an NFC reader. The lecturer would be able to keep track of who has signed in as the attendance screen is shown on the portal for the lecturer which would display a red circle for students who have not attended yet and green for those who have signed in.
Im using a backgroundworker which would allow the NFC reader to continuously listen for a card to be scanned and as soon as it does it needs to update the UI. This is the first time I've worked with backgroundworkers so i don't have enough knowledge of using them. The problem is that i do not know how to update the UI when the card is scanned and the student is recognized.
private void WaitChangeStatus(object sender, DoWorkEventArgs e)
{
nfcSer = new MainWindow();
while (!e.Cancel)
{
if (nfcSer.connectCard())
{
//this updates the student's attendance status to true
StudentsController.setAttendStudent(nfcSer.getcardUID(), Convert.ToInt32(Session["courseID"]));
//this calls the method which returns the same view of the attendance list of students however the student attendance status is changed.
classStudents(Session["ModuleName"].ToString());
}
}
}