mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
36 lines
963 B
C#
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();
|
|
}
|
|
}
|
|
}
|
|
}
|