Example #1
0
 public static void RequestNavigate(this INavigateAsync navigation, Uri target, NavigationParameters navigationParameters)
 {
     if (navigation == null)
     {
         throw new ArgumentNullException("navigation");
     }
     navigation.RequestNavigate(target, nr => { }, navigationParameters);
 }
Example #2
0
        /// <summary>
        /// Initiates navigation to the target specified by the <see cref="Uri"/>.
        /// </summary>
        /// <param name="navigation">The navigation object.</param>
        /// <param name="target">The navigation target</param>
        public static void RequestNavigate(this INavigateAsync navigation, Uri target)
        {
            if (navigation == null)
            {
                throw new ArgumentNullException(nameof(navigation));
            }

            navigation.RequestNavigate(target, _ => { });
        }
Example #3
0
        public void WhenNavigatingWithANullThisAndAUri_ThenThrows()
        {
            INavigateAsync navigate = null;
            Uri            target   = new Uri("test", UriKind.Relative);

            ExceptionAssert.Throws <ArgumentNullException>(
                () =>
            {
                navigate.RequestNavigate(target);
            });
        }
Example #4
0
        public void WhenNavigatingWithANullThis_ThenThrows()
        {
            INavigateAsync navigate = null;
            string         target   = "";

            ExceptionAssert.Throws <ArgumentNullException>(
                () =>
            {
                navigate.RequestNavigate(target);
            });
        }
Example #5
0
 public static void RequestNavigate(this INavigateAsync navigation, string target, NavigationParameters navigationParameters)
 {
     if (navigation == null)
     {
         throw new ArgumentNullException("navigation");
     }
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     navigation.RequestNavigate(new Uri(target, UriKind.RelativeOrAbsolute), nr => { }, navigationParameters);
 }
Example #6
0
        public static void RequestNavigate(this INavigateAsync navigation, string target, Action <NavigationResult> navigationCallback, NavigationParameters navigationParameters)
        {
            if (navigation == null)
            {
                throw new ArgumentNullException("navigation");
            }
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            var targetUri = new Uri(target, UriKind.RelativeOrAbsolute);

            navigation.RequestNavigate(targetUri, navigationCallback, navigationParameters);
        }
        /// <summary>
        /// Initiates navigation to the target specified by the <paramref name="target"/>.
        /// </summary>
        /// <param name="navigation">The navigation object.</param>
        /// <param name="target">The navigation target</param>
        /// <param name="navigationCallback">The callback executed when the navigation request is completed.</param>
        public static void RequestNavigate(this INavigateAsync navigation, string target, Action <IRegionNavigationResult> navigationCallback)
        {
            if (navigation == null)
            {
                throw new ArgumentNullException(nameof(navigation));
            }

            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            var targetUri = new Uri(target, UriKind.RelativeOrAbsolute);

            navigation.RequestNavigate(targetUri, navigationCallback);
        }
        public static NavigationResult Navigate(this INavigateAsync navigation, string target)
        {
            if (navigation == null)
            {
                throw new ArgumentNullException(nameof(navigation));
            }

            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            var targetUri = new Uri(target, UriKind.RelativeOrAbsolute);

            NavigationResult navigationResult = null;

            navigation.RequestNavigate(targetUri, arg =>
            {
                navigationResult = arg;
            });
            return(navigationResult);
        }