-
Notifications
You must be signed in to change notification settings - Fork 104
Scopes
Alexander Casall edited this page Nov 3, 2015
·
20 revisions
public class PersonMasterDetailScope implements Scope {
public ObjectProperty<Person> displayedPerson = ...
}
`public class PersonMasterViewModel implements ViewModel {
@InjectScope
private TestScope scope;
ObjectProperty<Person> selectedPerson = ...
public ScopedViewModelA() {
...
scope.displayedPerson.bind(selectedPerson);
...
}
}`
`public class PersonDetailViewModel implements ViewModel {
@InjectScope
private TestScope scope;
ObjectProperty<Person> selectedPerson = ...
public ScopedViewModelB() {
scope.displayedPerson.addListener((b,o,newSelectedPerson)->initViewModelWithPerson(newSelectedPerson));
}
}`