-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace Locator.Current with AppLocator.Current #4217
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
Conversation
Updated all usages of Locator.Current and Locator.CurrentMutable to AppLocator.Current and AppLocator.CurrentMutable across the codebase. This change standardizes dependency resolution and improves clarity regarding the application's service locator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the ReactiveUI codebase to replace Locator.Current and Locator.CurrentMutable with AppLocator.Current and AppLocator.CurrentMutable from the Splat dependency injection library. This standardizes dependency resolution throughout the framework. However, the PR also includes several unrelated changes to project files and documentation that should ideally be in separate PRs.
Key Changes
- Consistent replacement of
LocatorwithAppLocatoracross all ReactiveUI core, WPF, Winforms, and MAUI platform implementations - Removal of Windows 10.0.17763.0 platform support from project files (unrelated change)
- Removal of several PackageReference elements for netstandard (unrelated change)
- Documentation updates to DispatcherScheduler.cs (unrelated change)
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ReactiveUI/View/ViewLocator.cs | Updated to use AppLocator.Current for resolving IViewLocator |
| src/ReactiveUI/View/DefaultViewLocator.cs | Updated to use AppLocator.Current for service resolution |
| src/ReactiveUI/Suspension/SuspensionHostExtensions.cs | Updated to use AppLocator.Current for resolving ISuspensionDriver |
| src/ReactiveUI/ReactiveUI.csproj | Removed Windows 10.0.17763.0 support and netstandard PackageReferences (unrelated to main PR purpose) |
| src/ReactiveUI/Mixins/ReactiveNotifyPropertyChangedMixin.cs | Updated to use AppLocator.Current for resolving ICreatesObservableForProperty services |
| src/ReactiveUI/Mixins/DependencyResolverMixins.cs | Updated comments and code references from Locator to AppLocator |
| src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs | Updated to use AppLocator.Current for resolving binding converters and hooks |
| src/ReactiveUI/Bindings/Command/CreatesCommandBinding.cs | Updated to use AppLocator.Current for resolving ICreatesCommandBinding services |
| src/ReactiveUI/Bindings/Command/CommandBinder.cs | Updated to use AppLocator.Current for resolving ICommandBinderImplementation |
| src/ReactiveUI/Activation/ViewForMixins.cs | Updated to use AppLocator.Current for resolving IActivationForViewFetcher services |
| src/ReactiveUI.Wpf/Rx/Concurrency/DispatcherScheduler.cs | Changed class documentation format (unrelated to main PR purpose) |
| src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj | Removed Windows 10.0.17763.0 conditional compilation (unrelated to main PR purpose) |
| src/ReactiveUI.Wpf/Common/ViewModelViewHost.cs | Updated to use AppLocator.Current for resolving IPlatformOperations |
| src/ReactiveUI.Wpf/Common/RoutedViewHost.cs | Updated to use AppLocator.Current for resolving IPlatformOperations |
| src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj | Removed Windows 10.0.17763.0 conditional compilation (unrelated to main PR purpose) |
| src/ReactiveUI.Maui/RoutedViewHost.cs | Updated to use AppLocator.Current for resolving IScreen |
| src/ReactiveUI.Maui/ReactiveShellContent.cs | Updated to use AppLocator.Current for view resolution and null checks |
| src/ReactiveUI.Maui/Common/ViewModelViewHost.cs | Updated to use AppLocator.Current for resolving IPlatformOperations |
| src/ReactiveUI.Maui/Common/RoutedViewHost.cs | Updated to use AppLocator.Current for resolving IPlatformOperations |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4217 +/- ##
=======================================
Coverage 33.94% 33.94%
=======================================
Files 145 145
Lines 6269 6269
Branches 945 945
=======================================
Hits 2128 2128
Misses 3973 3973
Partials 168 168 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What kind of change does this PR introduce?
update
What is the new behavior?
Updated all usages of Locator.Current and Locator.CurrentMutable to AppLocator.Current and AppLocator.CurrentMutable across the codebase. This change standardizes dependency resolution and improves clarity regarding the application's service locator.
What might this PR break?
Locator usage replaced with underlying AppLocator, not expecting breaking change
Please check if the PR fulfills these requirements
Other information: