You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 8, 2025. It is now read-only.
<imgsrc="http://img.youtube.com/vi/qx8A4zIe9dU/hqdefault.jpg"alt="Watch the video" />
7
7
</a>
8
8
9
-
# MAUI PageResolver
10
-
A simple and lightweight page resolver for use in .NET MAUI projects.
9
+
# MAUI Smart Navigation (formerly PageResolver)
11
10
12
-
If you want a simple page resolver with DI without using a full MVVM framework (or if you want to use MVU), this package will let you navigate to fully resolved pages, with view models and dependencies, by calling:
11
+
> **📢 Important:** This library was renamed from `Plugin.Maui.PageResolver` to `Plugin.Maui.SmartNavigation` in v3.0 for .NET 10. See the [migration guide](#migrating-from-pageresolver-2x) below.
13
12
14
-
```cs
13
+
A simple and lightweight navigation solution for .NET MAUI projects with dependency injection support.
14
+
15
+
If you want a simple navigation solution with DI without using a full MVVM framework (or if you want to use MVU), this package will let you navigate to fully resolved pages, with view models and dependencies.
Automatically register dependencies in `IServiceCollection` with generated code. **Note:** The source generator is now **opt-in** in v3.0 (previously opt-out).
123
+
124
+
To enable, add the `[GenerateAutoDependencies]` attribute to your startup class or MauiProgram:
* Lifetime attributes - override convention-based service lifetimes (singleton for services, transient for pages and ViewModels) in the source generator
185
+
### Lifetime Attributes
186
+
187
+
Override convention-based service lifetimes (singleton for services, transient for pages and ViewModels) using attributes:
2.**Namespace Changes**: Update all namespace imports
221
+
```csharp
222
+
// Old
223
+
usingPlugin.Maui.PageResolver;
224
+
225
+
// New
226
+
usingPlugin.Maui.SmartNavigation;
227
+
```
228
+
229
+
3.**Source Generator Now Opt-In**: If you were using the source generator, add the attribute:
230
+
```csharp
231
+
[assembly: GenerateAutoDependencies]
232
+
```
233
+
234
+
### Migration Checklist
235
+
236
+
-[ ] Update NuGet package from `Plugin.Maui.PageResolver` to `Plugin.Maui.SmartNavigation`
237
+
-[ ] Update all `using Plugin.Maui.PageResolver` statements to `using Plugin.Maui.SmartNavigation`
238
+
-[ ] If using source generator, add `[assembly: GenerateAutoDependencies]` attribute
239
+
-[ ] (Optional) Migrate to `INavigationManager` for better DI support
240
+
-[ ] (Optional) Implement `IViewModelLifecycle` for async ViewModel initialization
241
+
-[ ] (Optional) Add `NavigatedInitBehavior` to pages that need initialization
242
+
-[ ] Update any custom analyzers or code that referenced the old package name
243
+
-[ ] Test all navigation flows to ensure they work correctly
244
+
245
+
### New Features to Consider
246
+
247
+
-**INavigationManager**: Consider injecting this service instead of using extension methods
248
+
-**NavigatedInitBehavior**: Enables async initialization in ViewModels
249
+
-**Type-Safe Routing**: Use `Route` records for Shell navigation
250
+
-**Improved GoBackAsync**: Automatically handles modal, Shell, and traditional navigation
251
+
252
+
## Getting Started
253
+
254
+
Check out the [wiki](https://github.com/matt-goldman/Plugin.Maui.SmartNavigation/wiki) for detailed guides and documentation.
91
255
92
-
Check out the full instructions in the wiki on [usingPageResolver](https://github.com/matt-goldman/Plugin.Maui.SmartNavigation/wiki/1-Using-the-PageResolver)
256
+
For full examples, see the [Demo Project](src/DemoProject) which showcases:
0 commit comments