예제 #1
0
        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);
        }
예제 #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();
        }
예제 #3
0
 private void OnRegionLoaded(object sender, RoutedEventArgs e)
 {
     _navigationService.CreateAndAddController(ControllerID);
     _navigationService.AddRegion(this);
     _navigationService.GetController(ControllerID).NavigateToInitial();
 }