Silverlight MVVM - Where does the asynchronous service logic go?

I have the beginning of my first Silverlight MVVM application and need to know where I should put the business logic, including asynchronous service calls. This happens on the page, where is the presentation? Am I just setting the ViewModel property that updates the view?

+3
source share
4 answers

Running MVVM in Silverlight is more complicated than in WPF, but we did. Yes, we are calling the asynchronous call service in the ViewModel. The β€œmodel” in our case is proxy objects that are sent back and forth upon a web service call. Unfortunately, this means that some of your functions are located in your ViewModel client, and some are server-side. There is no way around this.

... , Async Complete ViewModel , ( ) INotifyPropertyChanged ( INotifyCollectionChanged). "" -, INotifyPropertyChanged, ViewModel. , , .

+3

Microsoft . MVVM ASYNC.

+2

, , , .

+1

I put my calls to asynchronous services in the model and connected to events from my view model that fire when the data returns to the model.

+1
source

Source: https://habr.com/ru/post/1714920/


All Articles