Routing API revamp RFC
@RLittlesII is already working on this.
Since Sep 1, 2018.
Assessment
This issue has not been assessed yet.
Description
I just started experimenting with routing (UWP app), so while I have fresh eyes, some thoughts:
Rename RoutingState to Router
"Routing state" implies a container of state data rather than a class responsible for navigation actions. "Router" seems a better name for a class that actually handles routing. This is further reinforced by the fact that even on the IScreen interface, the RoutingState property name is "Router". IMO, Router is both more apt and concise.
Formalize navigation stack into a class
Today, we have a handful of commands hanging off RoutingState along with a ObservableCollection called "NavigationStack" (note that here it's not even a stack in the data structures sense of the term). It would be better to introduce a new class, NavigationStack with the following signature:
public class NavigationStack
{
ReactiveCommand<Unit> Advance { get; }
ReactiveCommand<Unit> Backtrack { get; }
IRoutableViewModel Current { get; }
}
This would leave no ambiguity about what the commands do. If there is value in it, the class can implement ObservableCollection to enable subscribing to notifications. Router would then have a read-only property named NavigationStack.
Replace the Navigate command with method + property
Is there value in Navigate being a command? Writing router.Navigate.Execute(vm) feels clunky. Would be better to have Navigate be a method, and have a companion Navigating observable property on Router. Another benefit is that the method can have an (optional) bool reset attribute, thus letting us drop the NavigateAndReset command on Router.
- Dominant language
- C#
- Stars
- 160
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reactiveui/Sextant
-
支持Avalonia 12版本Open
Difficulty 4/5 3-5 days Newbie friendliness 22/100
reactiveui/Sextant#965 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 32/100
reactiveui/Sextant#769 ·
-
Dependency DashboardOpen
Difficulty 4/5 3-5 days Newbie friendliness 20/100
reactiveui/Sextant#754 ·
-
feature request
Difficulty 5/5 Over a week Newbie friendliness 25/100
reactiveui/Sextant#225 · 1 comment ·
-
feature request
Difficulty 5/5 Over a week Newbie friendliness 25/100
reactiveui/Sextant#150 · 4 comments ·
All issues in reactiveui/Sextant
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Facepunch/sbox-public#12456 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
mcneel/rhino.inside-revit#1736 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reactiveui/Primitives#254 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Kyrodan/KeeAnywhere#510 ·
-
area-Tools-ILLink untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day