MVVM C# with the View on a remote Computer

271 views Asked by At

I'm designing a Client/Server App in C# where all the Model Object and calculation has to be done on the server. The server doesn't need a specific UI. Meanwhile I'd like my clients to be able to execute different functions or services from the server and receive the result of the computation from it as well as binding or subscribing to some values and each time the server update it, it sends the update to all clients who subscribed to this value.

Nothing spectacular in this I think. I dont have any background in Network or Server-Client apps.

My question is the following:

I'd like to bind directly properties of my ViewModel which is Server side to the View which is Client Side. Is there a way for me to do this like if the view was in a normal local MVVM framework? I'd like to avoid having to create a specific language between the clients and the server and having then to handle the queue and priorities of clients messages. If not, would you have some readings to recommend ?

Many Thanks.

1

There are 1 answers

1
Kelsie On

You don't want your views to rely on a network connection to stay responsive, even if you solve the technical challenges of what you are proposing. Networking should be done in a way that can fail gracefully.

This is bad and you should not do it. That's my opinion.

Additionally, you really shouldn't be designing your own protocol for communication. You could use something like WCF or another framework that allows you to just call a remote function.