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

Platform View to ViewModel location provider #2824

Merged
merged 2 commits into from Feb 21, 2023
Merged

Platform View to ViewModel location provider #2824

merged 2 commits into from Feb 21, 2023

Conversation

dansiegel
Copy link
Member

Description of Change

This migrates the updates for the ViewModelLocationProvider in Prism.Maui into the ViewModelLocationProvider in Prism.Core. This change is core to Prism.Maui being able to map multiple routes to a single View with the route being able to customize the ViewModel that should be resolved for the View.

Bugs Fixed

  • n/a

API Changes

Added:

  • static void ViewModelLocationProvider.SetDefaultViewToViewModelTypeResolver(Func<object, Type>);

Removed:

  • ViewModelLocationProvider2

Behavioral Changes

When the platform provides a delegate the delegate will be evaluated to determine if there is a mapping that should be used before we attempt to use reflection to locate the ViewModel. In Prism.Maui we do this by registering a mapping for each registration that contains the route name, View and ViewModel. If no ViewModel was provided in the Registration then it will fall back to the default reflection based location model Prism has always used.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard

@dansiegel dansiegel merged commit 5f3c3e1 into master Feb 21, 2023
@dansiegel dansiegel deleted the vml-update branch February 21, 2023 02:47
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.

None yet

2 participants