Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 2.42 KB

ReadMe.md

File metadata and controls

67 lines (48 loc) · 2.42 KB

Prism.Plugin.Popups

The Popups plugin provides an extremely lightweight framework for implementing Popup Pages using the Rg.Plugin.Popup package with Prism.Forms. To do this we simply provide you with some friendly extensions for the INavigationService so that you can navigate in a Prism friendly manner. Note that this does not currently support deep linking.

Current Build

Package Version
Prism.Plugin.Popups.Autofac 21
Prism.Plugin.Popups.DryIoc 22
Prism.Plugin.Popups.Ninject 23
Prism.Plugin.Popups.Unity 24

Usage

There are three primary extensions added for working with Navigation.

  • ClearPopupStackAsync
  • PopupGoBackAsync
  • PushPopupPageAsync

All three of these contain overloads so that you can pass in a NavigationParameters object, or if you have a single key value pair you can pass it in as shown below for the NavigateCommand.

public class MyPageViewModel : BindableBase
{
	INavigationService _navigationService { get; }

	public MyPageViewModel( INavigationService navigationService )
	{
		_navigationService = navigationService;
		NavigateCommand = new DelegateCommand( OnNavigateCommandExecuted );
		GoBackCommand = new DelegateCommand( OnGoBackCommandExecuted );
	}

	public DelegateCommand NavigateCommand { get; }

	public DelegateCommand GoBackCommand { get; }

	private async void OnNavigateCommandExecuted()
	{
		await _navigationService.PushPopupPageAsync( "SomePopupPage", "message", "hello from MyPage" );
	}

	private async void OnGoBackCommandExecuted()
	{
		await _navigationService.PopupGoBackAsync();
	}
}