How to use a third-party control in view mode?

I have a third-party control that, among other things, loads some data. I want my viewmodel to track this loading operation and adjust its own state accordingly.

If it depended on me, I would load the data far from the view, but it is not. So, I seem to be in a situation where my viewing model depends on my view. How do I deal with this? I feel pretty dirty doing public viewing of events in the viewmodel, but I see no other reasonable way to get this information in the viewmodel.

A similar situation can arise with standard controls - imagine if your viewing model depends on events coming from MediaElement - how do you model it correctly? Do you put a MediaElement in a viewmodel? It doesn’t sound like that.

If posting events to the viewmodel is indeed the most sensible way, is there a common template for this? How do you do this?

+3
source share
1 answer

, ViewModel . - . , ICommands ViewModel.

Caliburn - . ViewModel.

0

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


All Articles