Is it possible to bind a ViewModel inside Another? If so, how?
I need to mount a context something like this:
<div data-bind="visible: ViewModel_1.isVisible" />
//....
<div data-bind="source: ViewModel_Child1/>
// Contexto referente ao filho 1 da viewModel
</div>
<div data-bind="source: ViewModel_Child2/>
// Contexto referente ao filho 2 da viewModel
</div>
<div data-bind="source: ViewModel_ChildN/>
// Contexto referente ao filho N da viewModel
</div>
</div>
It would be a structure more or less like this:
public Pessoa {
public List<Contato> Contatos { get; set; }
public List<Referencia> Referencias { get; set; }
public List<Mensagem> Mensagens { get; set; }
}
And each List, will have a Grid ... pq will be a screen with several tabs
[Pessoa] | [Contato] | [Referencia] | [Mensagem] --- // onde | no exemplo seria um separador ou aba
And it will be a registry controlled by the same screen, in different controllers ...
so I do not need to make a complex viewModel to save every% of% of each tab ... I wanted to bind one to each, but having dataSource
as Father