Communicate with a serial device in a WPF application

I'm dabbling with the basics of communicating with a serial device from within a WPF application implementing an MVVM design. Right now I have a hard loopback and only expect to receive characters sent.

I have in the past seen hints of a Win Forms control to do this, and maybe a framework class, but right now I am a bit clueless as to what I can use in the spirit of an MVVM strategy.

Answers


I am a bit confused and it seems to me you might be overthinking MVVM. MVVM is a presentation pattern; serial communication is not presentation and it doesn't matter what your presentation layer is.

If I were to do this and I understand your problem correctly, I would have a class that encapsulates the serial communication. If you are only expecting characters to be sent to you, I'd have the class expose a basic "Received" event. Your View Model can then use an instance of this class to populate some properties that your View is attached to.

Hope this helps.


Need Your Help

Print integer barcode with zebra in CPCL language

java android printing barcode zebra-printers

I have an java app and I'm trying to print code. Everything works fine until my data is an integer,only digits. The printing is made in another function like this :

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.