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

Binding views to view models #34

Open
abrasat opened this issue Mar 23, 2020 · 3 comments
Open

Binding views to view models #34

abrasat opened this issue Mar 23, 2020 · 3 comments
Assignees
Labels

Comments

@abrasat
Copy link

abrasat commented Mar 23, 2020

First of all thank you for this very useful library.
Is it possible with TinyLittleMvvm to assign views to view models also dynamically in the start-up code, instead of doing it statically in the xaml file? Would be possible to assign different instances of the same view-model to different views?
Is there any schedule available for the release of a stable v2?

@thoemmi
Copy link
Owner

thoemmi commented Mar 23, 2020

Is it possible with TinyLittleMvvm to assign views to view models also dynamically in the start-up code, instead of doing it statically in the xaml file? Would be possible to assign different instances of the same view-model to different views?

There's no mapping in the XAML files. In fact, by default TinyLittleMvvm takes the full name of the view model, replaces ViewModel with View, and gets an instance from the DI container. E.g. for the view model MyApp.ViewModels.MyViewModel, it will ask for an instance of MyApp.Views.MyView.
You can customize it by changing ViewLocatorOptions, but still it only allows a mapping from view model type to view type.

What's you actual use case? Maybe we can find a solution.

Is there any schedule available for the release of a stable v2?

Well, as far as the code is concerned, it's ready for shipment. But I want to update the documentation before publishing it, as the API has changed significantly between v1 and v2.

@abrasat
Copy link
Author

abrasat commented Mar 24, 2020

Thank you for the explanation. I dont have yet a concrete use case. I was trying to understand how the mapping between views and view models works in TinyLittleMvvm, and what possibilities does it offer to customize it if needed (maybe adding some sample code to your repository for such a scenario would help).

@thoemmi
Copy link
Owner

thoemmi commented Mar 24, 2020

Yeah, documentation is on my list: #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants