Example #1
0
        /// <inheritdoc />
        public void NavigateToViewModel(Type viewModel, object extraData = null)
        {
            var viewType = ViewLocator.LocateTypeForModelType(viewModel, null, null);

            var packUri = ViewLocator.DeterminePackUriFromType(viewModel, viewType);

            var uri = new Uri(packUri, UriKind.Relative);

            frame.Navigate(uri, extraData);
        }
        /// <summary>
        /// Builds the URI.
        /// </summary>
        /// <returns>A uri constructed with the current configuration information.</returns>
        public Uri BuildUri()
        {
            var viewType = ViewLocator.LocateTypeForModelType(typeof(TViewModel), null, null);

            if (viewType == null)
            {
                throw new InvalidOperationException(string.Format("No view was found for {0}. See the log for searched views.", typeof(TViewModel).FullName));
            }

            var packUri = ViewLocator.DeterminePackUriFromType(typeof(TViewModel), viewType);
            var qs      = BuildQueryString();

            return(new Uri(packUri + qs, UriKind.Relative));
        }
Example #3
0
        /// <summary>
        /// Builds the URI.
        /// </summary>
        /// <returns>A uri constructed with the current configuration information.</returns>
        public Uri BuildUri()
        {
            var viewType = ViewLocator.LocateTypeForModelType(typeof(TViewModel), null, null);

            if (viewType == null)
            {
                throw new InvalidOperationException(string.Format("No view was found for {0}. See the log for searched views.", typeof(TViewModel).FullName));
            }

            var packUri = ViewLocator.DeterminePackUriFromType(typeof(TViewModel), viewType);
            var qs      = BuildQueryString();

#if WinRT
            // We need a value uri here otherwise there are problems using uri as a parameter
            return(new Uri("caliburn://" + packUri + qs, UriKind.Absolute));
#else
            return(new Uri(packUri + qs, UriKind.Relative));
#endif
        }