1

Topic: MVVM. Interaction View

All greetings. I try to light up one task, namely: Is at me AccountsView (AccountsViewModel + AccountsModel). In it are displayed the list of accounts. In AccountsView there is a button + - to create new . At a clique by the button, through Router the modal window opens. Router creates all: view, viewmodel, model connects and shows on the screen. Up until that time all is good. Further. In AccountView (without S) is the button "to add the address". Again through a router the new window of creation of the address opens. AddressView + AddressViewModel + AddressModel. The problem here begins: the address which should be result of operation AddressView should be added in an account. A question: how it is better results of operation of some View to give to the causing side?

2

Re: MVVM. Interaction View

Hello, lamer2001, you wrote: L> All greetings. L> I Try to light up one task, namely: L> Is at me AccountsView (AccountsViewModel + AccountsModel). In it are displayed the list of accounts. L> in AccountsView there is a button + - to create new . At a clique by the button, through Router the modal window opens. L> Router creates all: view, viewmodel, model connects and shows on the screen. L> up until that time all is good. L> further. In AccountView (without S) is the button "to add the address". Again through a router the new window of creation of the address opens. L> AddressView + AddressViewModel + AddressModel. L> the problem here begins: the address which should be result of operation AddressView should be added in an account. L> a question: how it is better results of operation of some View to give to the causing side? Generally it is useful to have service which is engaged in display of windows then all strongly becomes simpler. In this case one vm creates and opens another vm, and then takes away from it the necessary parameters. Or time of this all is not present, to issue data acquisition from the user in the form of function.

3

Re: MVVM. Interaction View

Hello, Qulac, you wrote: Q> Generally it is useful to have service which is engaged in display of windows then all strongly becomes simpler. Well in it at me is engaged Router. He knows as to create viewmodel's, model's and  Q> In this case one vm creates and opens another vm, and then takes away from it the necessary parameters. On idea MVVM, vm should know nothing about view as well as model does not know anything about viewmodel

4

Re: MVVM. Interaction View

Hello, lamer2001, you wrote: L> Hello, Qulac, you wrote: Q>> Generally it is useful to have service which is engaged in display of windows then all strongly becomes simpler. L> well in it at me is engaged Router. He knows as to create viewmodel's, model's and  Q>> In this case one vm creates and opens another vm, and then takes away from it the necessary parameters. L> on idea MVVM, vm should know nothing about view as well as model does not know anything about viewmodel And it and will not know, she will know only service, and service will already understand as to connect view and viewModel. Should be type such: WindowService. Open (ViewModel vm)