FirstViewModel.cs 606 B

12345678910111213141516171819202122232425
  1. using System.Windows.Input;
  2. using Cirrious.MvvmCross.ViewModels;
  3. namespace Xamarin_Insights.ViewModels
  4. {
  5. public class FirstViewModel
  6. : MvxViewModel
  7. {
  8. private MvxCommand _gotoSecondViewCommand;
  9. public ICommand GotoSecondViewCommand
  10. {
  11. get
  12. {
  13. _gotoSecondViewCommand = _gotoSecondViewCommand ?? new MvxCommand(DoGotoSecondViewCommand);
  14. return _gotoSecondViewCommand;
  15. }
  16. }
  17. private void DoGotoSecondViewCommand()
  18. {
  19. ShowViewModel<SecondViewModel>();
  20. }
  21. }
  22. }