0

I want to implement at simple application that displays a Label with the status of a SerialPort object. The Label's content property is bound to the SerialPort's isOpen property.

The problem is that when the SerialPort closes, the Label's content does not update!

The SerialPort object is a property in my code behind, I tried implementing INotifyPropertyChanged but that doesn't help me much since I don't know when the port actually opens or closes.

Any ideas on how to solve this issue?

the86guy
  • 133
  • 1
  • 4
  • There is no event that fires in the OS (that i know of) that will tell you that the port has closed. You simply have to poll. – crthompson Nov 05 '13 at 17:41
  • Really? I thought data binding things like this easier :( – the86guy Nov 05 '13 at 17:55
  • A ton easier! On things that you control. Check out [this SO question](http://stackoverflow.com/questions/13408476/detecting-when-a-serialport-gets-disconnected) – crthompson Nov 05 '13 at 17:59
  • I've used the Flex Framework with FlashBuilder in the past which had databinding. Though I remember I could bind to any native object's properties. How can I tell if it's possible to rely on a property notifying you of a change when you're binding to it and you don't have control over that property? – the86guy Nov 05 '13 at 18:02

0 Answers0