private void OnRegionUnloaded(object sender, RoutedEventArgs e)
        {
            bool shouldCancel = _navigationService.GetController(ControllerID).CallOnLeavingNavigation(false);

            if (shouldCancel)
            {
                throw new InvalidOperationException("Can't cancel navigation from 'OnLeave' when higher-level controller is the one navigating. " +
                                                    "Check value 'CancellingNavigationAllowed' property in LeavingPageEventArgs.");
            }
            _navigationService.RemoveController(ControllerID);
            _navigationService.RemoveRegion(this);
        }
Beispiel #2
0
        private void OnRegionLoaded(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(ControllerID))
            {
                throw new NullReferenceException($"A loaded Region doesn't have 'ControllerID' set to anything");
            }

            _navigationService.CreateAndAddController(ControllerID);
            _navigationService.AddRegion(this);
            _navigationService.GetController(ControllerID).NavigateToInitial();
        }
Beispiel #3
0
 private void OnRegionLoaded(object sender, RoutedEventArgs e)
 {
     _navigationService.CreateAndAddController(ControllerID);
     _navigationService.AddRegion(this);
     _navigationService.GetController(ControllerID).NavigateToInitial();
 }