RegionViewModelBase.cs 908 B

1234567891011121314151617181920212223242526272829303132333435
  1. using Prism.Regions;
  2. using System;
  3. namespace LogoForceTestApp.Core.Mvvm
  4. {
  5. public class RegionViewModelBase : ViewModelBase, INavigationAware, IConfirmNavigationRequest
  6. {
  7. protected IRegionManager RegionManager { get; private set; }
  8. public RegionViewModelBase(IRegionManager regionManager)
  9. {
  10. RegionManager = regionManager;
  11. }
  12. public virtual void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
  13. {
  14. continuationCallback(true);
  15. }
  16. public virtual bool IsNavigationTarget(NavigationContext navigationContext)
  17. {
  18. return true;
  19. }
  20. public virtual void OnNavigatedFrom(NavigationContext navigationContext)
  21. {
  22. }
  23. public virtual void OnNavigatedTo(NavigationContext navigationContext)
  24. {
  25. }
  26. }
  27. }