Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access ViewModel #78

Closed
sialcasa opened this issue Jul 9, 2014 · 1 comment
Closed

Access ViewModel #78

sialcasa opened this issue Jul 9, 2014 · 1 comment
Assignees
Milestone

Comments

@sialcasa
Copy link
Owner

sialcasa commented Jul 9, 2014

Durch den Wechsel von einem getter auf Annotationen in der view, um das ViewModel zu referenzieren, hat man nach dem laden einer view über den ViewLoader bzw. ViewTuple, keine Möglichkeit, das ViewModel zu referenzieren. Workaround ist, einen getter auf das ViewModel in der View zu erstellen.

Soll: ViewTuple hat einen getter auf das erstelle ViewModel.

@sialcasa sialcasa added this to the 0.3.0 milestone Jul 9, 2014
@manuel-mauky
Copy link
Collaborator

In der aktuellen Implementierung des DI-mechanismus kann es passieren, dass das ViewModel für FxmlViews doppelt injekted wird:

Wenn der User sich aus der DI-Facade eine Controller-Instanz holt hat diese bereits ein ViewModel injekted.
Wird diese Instanz beim Aufruf von ViewLoader mitgegeben, dann wird im FxmlViewLoader trotzdem nochmal das ViewModel injekted und dabei das erste ViewModel überschrieben.
Dieses Verhalten sollte hier gleich mit gefixt werden da es direkt damit zusammenhängt.

manuel-mauky added a commit that referenced this issue Jul 24, 2014
…n existing instance of the codeBehind is set to the ViewLoader.
manuel-mauky added a commit that referenced this issue Jul 24, 2014
…f a given View. This way we can now set the ViewModel in the loaded ViewTuple
manuel-mauky added a commit that referenced this issue Jul 25, 2014
manuel-mauky added a commit that referenced this issue Jul 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants