I have a wpf app that has multiple sockets open to various hosts. The hosts will be intermittently sending packets and I will occasionally have to send packets to the hosts. I have the app working where the socket threads dispatch calls to the ui thread to display data. The app is growing to where it will have multiple UI "widgets/controls" where multiple widgets may display data (different renderings) from a single socket. It would be nice to have some observablecollections that exist on the UI thread. And the sockets send weak events to the UI thread. The ui thread updates the collections and ,voila, the widgets update. To send from the UI to the socket, perhaps have a stream with synchronized access?
是否有任何人对使这一设计成为可维持的可维持性的建议?