Comments (5)
I like that change, it indeed confused me initially.
Would it also be possible to rename the IViewModel
interface? IMO the interface should denote that the implementing view model participates in routing. In @kentcb's original implementation he deliberately distinguished between IModalViewModel
and IPageViewModel
which is more readable IMO. A unified interface also is fine, as long as there is more distinction. Here some ideas:
ISextantViewModel
IViewStackViewModel
, taken by ReactiveUIIRoutableViewModel
, maybe too easy to confuse withIRoutingViewModel
IRoutableViewModel
?
Additionally, I don't see a reason for the new()
constraint on RegisterViewModel<>()
method.
ReactiveUI recommends the following pattern for dependency resolution which allows for good unit testing:
public HomeViewModel(AuthenticationService authenticationService = null)
{
_authenticationService = authenticationService ?? Locator.Current.GetService<AuthenticationService>();
}
The pattern violates the new()
constraint on RegisterViewModel<>()
, though.
from sextant.
Is it ok if I start looking into this one?
from sextant.
@schnerring You are correct on several counts. The original did have two interfaces. When we ported it we didn't want a marker interface to be required if your plan was to display a page modally or not.
For the v3 API I have been considering ISextantViewModel
for the base extension point.
That is a good point. The new()
constraint was probably an oversight. It's intention was to force a segragation and could easily be reworked.
There will most likely need to be some form of a RegisterForNavigation<TView>(Func<TViewModel>)
as folks who prefer to locate their ViewModels themselves will have to provide a delegate for registration.
from sextant.
@rms81 Yes. This is a good first time story. If you want to get started on it, feel free. If you need help reach out.
from sextant.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from sextant.
Related Issues (20)
- feature: Add navigation for AvaloniaUI HOT 2
- feature: Master Detail Support For Xamarin Forms HOT 5
- [BUG] Sextant sample navigation crashes with Android.Util.AndroidRuntimeException: 'Animators may only be run on Looper threads' HOT 8
- [BUG] PopRootAndTick in ViewStackServiceBase leaves behind the wrong viewmodel HOT 9
- [BUG] navigationService.PopPage does not trigger WhenNavigatedTo HOT 5
- feature: Provide a destruction hook for when the VM/view is going to be popped HOT 2
- [BUG] Can't build UWP HOT 13
- feature: Provide a way to detect when navigation to a view-model is completed, even if no navigation-parameter is being passed HOT 4
- feature: Provide an initialization hook for when the VM/view is going to be added to the stack/pushed HOT 1
- [BUG] Allow ViewModelFactory to resolve Views with contracts HOT 4
- [BUG] WhenNavigatedFrom not being called HOT 2
- Apps With a Splash Page? HOT 6
- feature: Add support for Avalonia HOT 3
- [BUG] When calling Locator.CurrentMutable.RegisterNotificationView get exception HOT 7
- [BUG] PushModal does not allways show View HOT 6
- feature: help with winui 3 support HOT 3
- Dependency Dashboard
- [Bug]: IParameterViewStackService - InvalidOperationException: IView not registered HOT 2
- [Bug]: PushModal results in crash: Cannot set 'scaleX' to Infinity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sextant.