public MainPage() { InitializeComponent(); //TODO get config from _movementManager = new MovementManager(2, 4); _personManager = new PersonManager(); _personManager.PeopleReceivedEventHandler += new EventHandler <List <Person> >(PeopleReceived); _pobCount = 0; txtCount.Text = _pobCount.ToString(); PeopleOnBoard = new SortedObservableCollection <PobItem>(); DataContext = this; _personService = new PersonService(); _dispatcher = Window.Current.Dispatcher; //start background task to connect to card Reader. var task = new Task(async() => await CreateNfcReader()); task.Start(); //Mqtt Service Connect MqttService.Connect(); MqttService.MessageReceived += new EventHandler <Movement>(MovementMessage); }