/// <summary>
        /// Creates an <see cref="INavigator"/> bound to the specified frame. This method can
        /// be called multiple times for the same <paramref name="frame"/>.
        /// </summary>
        /// <param name="frame">The navigation service which will be used if the view renders page information.</param>
        /// <param name="parent">The parent navigator that created this navigator.</param>
        /// <returns>
        /// An instance of the <see cref="INavigator"/> interface which can be used for navigation.
        /// </returns>
        public INavigator CreateNavigator(Frame frame, INavigator parent)
        {
            Guard.ArgumentNotNull(frame, "frame");

            return(ExistingNavigator.Get(frame,
                                         () => NewNavigator(() => new FrameNavigationServiceWrapper(frame.Dispatcher, frame), parent)));
        }
        /// <summary>
        /// Creates an <see cref="INavigator"/> bound to the specified navigation service. This method can
        /// be called multiple times for the same <paramref name="navigationService"/>.
        /// </summary>
        /// <param name="navigationService">The navigation service which will be used if the view renders
        /// page information.</param>
        /// <param name="parent">The parent navigator that created this navigator.</param>
        /// <returns>
        /// An instance of the <see cref="INavigator"/> interface which can be used for navigation.
        /// </returns>
        public INavigator CreateNavigator(INavigationService navigationService, INavigator parent)
        {
            Guard.ArgumentNotNull(navigationService, "navigationService");

            return(ExistingNavigator.Get(navigationService,
                                         () => NewNavigator(() => navigationService, parent)));
        }
        /// <summary>
        /// Creates an <see cref="INavigator"/> bound to the specified frame. This method can
        /// be called multiple times for the same <paramref name="frame"/>.
        /// </summary>
        /// <param name="frame">The navigation service which will be used if the view renders page information.</param>
        /// <param name="parent">The parent navigator that created this navigator.</param>
        /// <returns>
        /// An instance of the <see cref="INavigator"/> interface which can be used for navigation.
        /// </returns>
        public INavigator CreateNavigator(ContentControl frame, INavigator parent)
        {
            Guard.ArgumentNotNull(frame, "frame");


            if (frame is ButtonBase || frame is Label)
            {
                throw new ArgumentException("An attempt was made to create an INavigator for a '{0}', which should not be used as navigation containers. If the intention was to find a navigator that owns the UI element, the NavigatorFactory.GetOwningNavigator method should be used instead.");
            }

            return(ExistingNavigator.Get(frame, () =>
                                         frame is Frame
                                ? CreateNavigator((Frame)frame)
                                                : NewNavigator(() => new ContentNavigationServiceWrapper(frame), parent)));
        }