{"id":14966904,"url":"https://github.com/reactiveui/sextant","last_synced_at":"2025-05-15T12:02:32.278Z","repository":{"id":31755145,"uuid":"128789863","full_name":"reactiveui/Sextant","owner":"reactiveui","description":"A ReactiveUI navigation library for Xamarin.Forms","archived":false,"fork":false,"pushed_at":"2025-05-09T06:13:53.000Z","size":2001,"stargazers_count":160,"open_issues_count":24,"forks_count":26,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-09T07:26:29.435Z","etag":null,"topics":["hacktoberfest","mvvm-framework","navigation","reactiveui","reactiveui-navigation-library","sextant","xamarin"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reactiveui.png","metadata":{"funding":{"github":["reactivemarbles"]},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-09T15:03:45.000Z","updated_at":"2025-04-07T05:55:50.000Z","dependencies_parsed_at":"2023-12-19T04:23:04.070Z","dependency_job_id":"fd02e078-6b89-492b-884e-93f6a69fad07","html_url":"https://github.com/reactiveui/Sextant","commit_stats":{"total_commits":480,"total_committers":21,"mean_commits":"22.857142857142858","dds":0.6625,"last_synced_commit":"e221e445ab91d92739f69e7e63996bd19894d882"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveui%2FSextant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveui%2FSextant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveui%2FSextant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveui%2FSextant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactiveui","download_url":"https://codeload.github.com/reactiveui/Sextant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","mvvm-framework","navigation","reactiveui","reactiveui-navigation-library","sextant","xamarin"],"created_at":"2024-09-24T13:37:07.718Z","updated_at":"2025-05-15T12:02:32.241Z","avatar_url":"https://github.com/reactiveui.png","language":"C#","funding_links":["https://github.com/sponsors/reactivemarbles"],"categories":[],"sub_categories":[],"readme":"## Sextant\n\n[![NuGet Stats](https://img.shields.io/nuget/v/sextant.svg)](https://www.nuget.org/packages/sextant) ![Build](https://github.com/reactiveui/Sextant/workflows/Build/badge.svg) [![Code Coverage](https://codecov.io/gh/reactiveui/sextant/branch/main/graph/badge.svg)](https://codecov.io/gh/reactiveui/sextant)\n[![](https://img.shields.io/nuget/dt/sextant.svg) ](https://www.nuget.org/packages/sextant) [![](https://img.shields.io/badge/chat-slack-blue.svg)](https://reactiveui.net/slack)\n\n\u003cp align=\"left\"\u003e\u003cimg src=\"https://github.com/reactiveui/styleguide/blob/master/logo_sextant/vertical.png?raw=true\" alt=\"Sextant\" height=\"180px\"\u003e\u003c/p\u003e\n\n## A ReactiveUI view model based navigation library\n\nSextant was born from a fork of [Xamvvm](https://github.com/xamvvm/xamvvm) which is nice and simple MVVM Framework with a good navigation system. The problem is, I just wanted a simple navigation system to use with [ReactiveUI](https://github.com/reactiveui/ReactiveUI) without all the things that come along an MVVM framework. Plus, I wanted to make it more \"Reactive Friendly\".\n\nThen a wild [Rodney Littles](https://github.com/rlittlesii) appears, and with him an implementation of this [AMAZING POST](https://kent-boogaart.com/blog/custom-routing-in-reactiveui) by [Kent](https://github.com/kentcb)\n\nSextant is in a very initial stage and in constant change, so please be pantience with use... because we will break things.\n\nThis library is nothing more than me \"standing on the shoulders of giants\":\n[Kent](https://github.com/kentcb) for been the original and true creator of this, I pretty much just copied and pasted it :)\n[Geoffrey Huntley](https://github.com/ghuntley) maintainer on [ReactiveUI](https://github.com/reactiveui/ReactiveUI).\n\n## NuGet Installation\n\nInstall the nuget package on your Forms project and ViewModels project.\n\n### GitHub\nPre release packages are available at https://nuget.pkg.github.com/reactiveui/index.json\n\n### NuGet\n\n| Platform          | Sextant Package                  | NuGet                    |\n| ----------------- | -------------------------------- | ------------------------ |\n| UWP               | [Sextant][UwpDoc]                | [![CoreBadge]][Core]     |\n| Xamarin.Forms     | [Sextant.XamForms][XamDoc]       | [![XamBadge]][Xam]       |\n| Xamarin.Forms     | [Sextant.Plugins.Popup][XamDoc]   | [![PopupBadge]][Popup]   |\n| Xamarin.iOS       | [Sextant][IosDoc]                | [![CoreBadge]][Core]     |\n| Avalonia          | [Sextant.Avalonia][AvaloniaDoc]  | [![CoreBadge]][Avalonia] |\n\n[Core]: https://www.nuget.org/packages/Sextant/\n[CoreBadge]: https://img.shields.io/nuget/v/Sextant.svg\n[CoreDoc]: https://reactiveui.net/docs/getting-started/installation/\n[IosDoc]: https://reactiveui.net/docs/getting-started/installation/xamarin-ios\n[UwpDoc]: https://reactiveui.net/docs/getting-started/installation/universal-windows-platform\n[AvaloniaDoc]: https://www.reactiveui.net/docs/getting-started/installation/avalonia\n\n[Xam]: https://www.nuget.org/packages/Sextant.XamForms/\n[XamBadge]: https://img.shields.io/nuget/v/Sextant.XamForms.svg\n[Popup]: https://www.nuget.org/packages/Sextant.Plugins.Popup/\n[PopupBadge]: https://img.shields.io/nuget/v/Sextant.Plugins.Popup.svg\n[XamDoc]: https://reactiveui.net/docs/getting-started/installation/xamarin-forms\n[Avalonia]: https://www.nuget.org/packages/Sextant.Avalonia/\n\n### Target Platform Versions\n\n##### Verify you have the [minimum version](https://reactiveui.net/docs/getting-started/minimum-versions#platform-minimums) for your target platform (i.e. Android, iOS, Tizen).\n\n## Register Components\n\n### Views\n\nVersion 2.0 added new extensions methods for the `IMutableDepedencyResolver` that allow you to register an `IViewFor` to a View Model.\n\n```csharp\nLocator\n    .CurrentMutable\n    .RegisterNavigationView(() =\u003e new NavigationView(RxApp.MainThreadScheduler, RxApp.TaskpoolScheduler, ViewLocator.Current))\n    .RegisterParameterViewStackService()\n    .RegisterViewForNavigation(() =\u003e new PassPage(), () =\u003e new PassViewModel())\n    .RegisterViewForNavigation(() =\u003e new ReceivedPage(), () =\u003e new ReceivedViewModel());\n```\n\nSet the initial page:\n```csharp\nLocator\n    .Current\n    .GetService\u003cIParameterViewStackService\u003e()\n    .PushPage\u003cPassViewModel\u003e()\n    .Subscribe();\n\nMainPage = Locator.Current.GetNavigationView(\"NavigationView\");\n```\n\n## Use the Navigation Service\n\nAfter that all you have to do is call one of the methods inside your ViewModels:\n```csharp\n/// \u003csummary\u003e\n/// Pops the \u003csee cref=\"IPageViewModel\"/\u003e off the stack.\n/// \u003c/summary\u003e\n/// \u003cparam name=\"animate\"\u003eif set to \u003cc\u003etrue\u003c/c\u003e [animate].\u003c/param\u003e\n/// \u003creturns\u003e\u003c/returns\u003e\nIObservable\u003cUnit\u003e PopModal(bool animate = true);\n\n/// \u003csummary\u003e\n/// Pops the \u003csee cref=\"IPageViewModel\"/\u003e off the stack.\n/// \u003c/summary\u003e\n/// \u003cparam name=\"animate\"\u003eif set to \u003cc\u003etrue\u003c/c\u003e [animate].\u003c/param\u003e\n/// \u003creturns\u003e\u003c/returns\u003e\nIObservable\u003cUnit\u003e PopPage(bool animate = true);\n\n/// \u003csummary\u003e\n/// Pushes the \u003csee cref=\"IPageViewModel\"/\u003e onto the stack.\n/// \u003c/summary\u003e\n/// \u003cparam name=\"modal\"\u003eThe modal.\u003c/param\u003e\n/// \u003cparam name=\"contract\"\u003eThe contract.\u003c/param\u003e\n/// \u003creturns\u003e\u003c/returns\u003e\nIObservable\u003cUnit\u003e PushModal(IPageViewModel modal, string contract = null);\n\n/// \u003csummary\u003e\n/// Pushes the \u003csee cref=\"IPageViewModel\"/\u003e onto the stack.\n/// \u003c/summary\u003e\n/// \u003cparam name=\"page\"\u003eThe page.\u003c/param\u003e\n/// \u003cparam name=\"contract\"\u003eThe contract.\u003c/param\u003e\n/// \u003cparam name=\"resetStack\"\u003eif set to \u003cc\u003etrue\u003c/c\u003e [reset stack].\u003c/param\u003e\n/// \u003cparam name=\"animate\"\u003eif set to \u003cc\u003etrue\u003c/c\u003e [animate].\u003c/param\u003e\n/// \u003creturns\u003e\u003c/returns\u003e\nIObservable\u003cUnit\u003e PushPage(IPageViewModel page, string contract = null, bool resetStack = false, bool animate = true);\n```\n\n### Example\n```csharp\npublic class ViewModel\n{\n    private readonly IViewStackServicen _viewStackService; // or IParameterViewStackServicen\n\n    public ViewModel(IViewStackServicen viewStackService)\n    {\n        _viewStackService = viewStackService;\n\n        OpenModal = ReactiveCommand\n            // FirstModalViewModel must implement IViewModel or INavigable\n            .CreateFromObservable(() =\u003e viewStackService.PushModal\u003cFirstModalViewModel\u003e(),\n                outputScheduler: RxApp.MainThreadScheduler);\n    }\n\n    public ReactiveCommand\u003cUnit, Unit\u003e OpenModal { get; }\n}\n```\n\n## Pass Parameters\n\nVersion 2.0 added support for passing parameters when navigating.\n\n### Example\n\n```csharp\npublic class ViewModel\n{\n    private readonly IParameterViewStackServicen _viewStackService;\n\n    public ViewModel(IParameterViewStackServicen viewStackService)\n    {\n        _viewStackService = viewStackService;\n\n        Navigate = ReactiveCommand\n            // NavigableViewModel must implement INavigable\n            .CreateFromObservable(() =\u003e viewStackService.PushModal\u003cNavigableViewModel\u003e(new NavigationParameter { { \"parameter\", parameter } }),\n                outputScheduler: RxApp.MainThreadScheduler);\n    }\n\n    public ReactiveCommand\u003cUnit, Unit\u003e Navigate { get; }\n}\n```\n\nThe `INavigable` interface exposes view model lifecycle methods that can be subscribed to.  These methods unbox your parameter object. Implementing the interface allows you to assign values to the View Model during Navigation.\n\n```csharp\npublic class NavigableViewModel : INavigable\n{\n        public string? _parameter;\n\n        public IObservable\u003cUnit\u003e WhenNavigatedFrom(INavigationParameter parameter)\n        {\n            return Observable.Return(Unit.Default)\n        }\n\n        public IObservable\u003cUnit\u003e WhenNavigatedTo(INavigationParameter parameter)\n        {\n            parameter.TryGetValue(\"parameter\", out _parameter);\n            return Observable.Return(Unit.Default);\n        }\n\n        public IObservable\u003cUnit\u003e WhenNavigatingTo(INavigationParameter parameter)\n        {\n            return Observable.Return(Unit.Default);\n        }\n}\n```\n\n## Samples\n\n- [Sample](https://github.com/reactiveui/Sextant/tree/main/Sample)\n- [Navigation Parameter Sample](https://github.com/reactiveui/ReactiveUI.Samples/tree/main/xamarin-forms/Navigation.Parameters)\n\n## Contribute\n\nSextant is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. We ❤ the people who are involved in this project, and we’d love to have you on board, especially if you are just getting started or have never contributed to open-source before.\n\nSo here's to you, lovely person who wants to join us — this is how you can support us:\n\n* [Responding to questions on StackOverflow](https://stackoverflow.com/questions/tagged/sextant)\n* [Passing on knowledge and teaching the next generation of developers](http://ericsink.com/entries/dont_use_rxui.html)\n* Submitting documentation updates where you see fit or lacking.\n* Making contributions to the code base.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactiveui%2Fsextant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactiveui%2Fsextant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactiveui%2Fsextant/lists"}