コード例 #1
0
        /// <summary>
        /// Returns the candidate TargetContract based on the <see cref="NavigationContext"/>.
        /// </summary>
        /// <param name="navigationContext">The navigation contract.</param>
        /// <returns>The candidate contract to seek within the <see cref="IRegion"/> and to use, if not found, when resolving from the container.</returns>
        protected virtual string GetContractFromNavigationContext(NavigationContext navigationContext)
        {
            if (navigationContext == null)
            {
                throw new ArgumentNullException(nameof(navigationContext));
            }
            var candidateTargetContract = UriParsingHelper.GetAbsolutePath(navigationContext.Uri);

            candidateTargetContract = candidateTargetContract.TrimStart('/');
            return(candidateTargetContract);
        }