/// <summary> /// Returns the set of candidates that may satisfy this navigation request. /// </summary> /// <param name="region">The region containing items that may satisfy the navigation request.</param> /// <param name="candidateNavigationContract">The candidate navigation target as determined by <see cref="GetContractFromNavigationContext"/></param> /// <returns>An enumerable of candidate objects from the <see cref="IRegion"/></returns> protected virtual IEnumerable <VisualElement> GetCandidatesFromRegion(IRegion region, string candidateNavigationContract) { if (region is null) { throw new ArgumentNullException(nameof(region)); } if (string.IsNullOrEmpty(candidateNavigationContract)) { throw new ArgumentNullException(nameof(candidateNavigationContract)); } var contractCandidates = GetCandidatesFromRegionViews(region, candidateNavigationContract); if (!contractCandidates.Any()) { var matchingType = _container.GetRegistrationType(candidateNavigationContract); if (matchingType is null) { return(Array.Empty <VisualElement>()); } return(GetCandidatesFromRegionViews(region, matchingType.FullName)); } return(contractCandidates); }