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

GetViewFor in CompositionRoot #53

Merged
merged 1 commit into from
Feb 5, 2024
Merged

GetViewFor in CompositionRoot #53

merged 1 commit into from
Feb 5, 2024

Conversation

kgday
Copy link
Contributor

@kgday kgday commented Feb 5, 2024

This pull request adds 2 methods in CompositionRoot:
HasViewFor(vm)
GetViewFor(vm)

This allows us to retrieve a view for an instance of a view model as opposed to using the existing GetView which creates both the view model and the view. I believe there is a place for both.

For example having GetViewFor with a static variable for the AppCompositionRoot, we can modify the ViewLocator to use the composition root to get us a registered view for the given viewmodel rather than use reflection.

@JordanMarr JordanMarr merged commit 8351a4c into JordanMarr:main Feb 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants