borepin/Borepin/Borepin/PageModel/MainPagePageModel.cs
2020-11-13 23:11:27 +01:00

36 lines
963 B
C#

using Prism.Mvvm;
using Prism.Navigation;
using System.Windows.Input;
using Xamarin.Forms;
namespace Borepin.PageModel
{
public class MainPagePageModel : BindableBase
{
private INavigationService _NavigationService;
public MainPagePageModel(INavigationService navigationService)
{
_NavigationService = navigationService;
NavigateCommand = new Command<string>(NavigateCommandExecuted);
}
private ICommand _NavigationCommand;
public ICommand NavigateCommand
{
get => _NavigationCommand;
set => SetProperty(ref _NavigationCommand, value);
}
private async void NavigateCommandExecuted(string view)
{
var result = await _NavigationService.NavigateAsync($"NavigationPage/{view}");
if(!result.Success)
{
System.Diagnostics.Debugger.Break();
}
}
}
}