public class PageNavigator : BaseViewModel, IPageNavigator
{
private Dictionary<Type, Page> pages = new Dictionary<Type, Page>();
private Stack<Page> historyPages = new Stack<Page>();
Page currentPage;
public Page CurrentPage
{
get => currentPage;
set => Set( ref currentPage, value );
}
public void NextPage<T, U>( U data )
{
var page = (Page)Activator.CreateInstance( typeof( T ), this, data );
CurrentPage = page;
historyPages.Push( page );
}
public void NextPage<T>()
{
var page = (Page)Activator.CreateInstance( typeof( T ), this );