Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotnet-ad/Xam.Forms.NavigationExtensions
Helpers for Xamarin.Forms application navigation system : passing arguments, restoration.
https://github.com/dotnet-ad/Xam.Forms.NavigationExtensions
Last synced: 30 days ago
JSON representation
Helpers for Xamarin.Forms application navigation system : passing arguments, restoration.
- Host: GitHub
- URL: https://github.com/dotnet-ad/Xam.Forms.NavigationExtensions
- Owner: dotnet-ad
- License: mit
- Created: 2016-05-05T17:45:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-22T17:56:43.000Z (over 2 years ago)
- Last Synced: 2024-09-24T00:02:28.180Z (3 months ago)
- Language: C#
- Size: 1.18 MB
- Stars: 10
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - NavigationExtensions for Xamarin.Forms ★10
README
![Logo](./icon.png)
# NavigationExtensions for Xamarin.Forms
Those extensions for **Xamarin.Forms** basicaly add storage of the navigation history when the application stops. Extensions has been prefered to subclassing for more flexibility.
## Installation
The library is available on [NuGet](https://www.nuget.org/packages/Xam.Forms.NavigationExtensions/).
To install NavigationExtensions, run the following command in the Package Manager Console.
PM> Install-Package Xam.Forms.NavigationExtensions
## Quickstart
Once you installed the package, extension methods will be automaticaly added to `INavigation` and `Page`.
To add storage and restoration of navigation stack :
```csharp
public class App : Application
{
public App()
{
MainPage = new NavigationPage(new HomePage());
}protected override async void OnStart()
{
// If the app is launched one hour after its last stop, its navigation history
// will be restored.
await this.MainPage.Navigation.RestoreAsync("Main", TimeSpan.FromHours(1));
}protected override void OnSleep()
{
this.MainPage.Navigation.Store("Main");
}
}
```To navigate from a page to another by passing arguments :
```csharp
this.Navigation.PushAsync(item.Identifier, true);
```And finaly access navigation argument from your destination page :
```csharp
var albumId = (int) this.GetNavigationArgs();
```## Sample
A complete application sample is available in the source code solution.
## Build and publish
Publishing is done through [Visual Studio Team Services](https://alois-deniel.visualstudio.com/) with a manual trigger.
## Roadmap / ideas
* Add more helpers for selected tab item, scrolling amount, textfield
## Copyright and license
Code and documentation copyright 2016 Aloïs Deniel released under the MIT license.