예제 #1
0
        private void OnNavigateTitleLink(object sender, ExecutedRoutedEventArgs e)
        {
            if (LinkNavigator == null)
            {
                return;
            }

            var titleLink = e.Parameter as TitleLink;

            if (titleLink?.GroupKey != null)
            {
                _menu?.SwitchToGroupByKey(titleLink.GroupKey);
                return;
            }

            Uri    uri;
            string parameter;
            string targetName;

            var eParameter = (e.Parameter as Link)?.Source ?? e.Parameter;

            if (NavigationHelper.TryParseUriWithParameters(eParameter, out uri, out parameter, out targetName))
            {
                LinkNavigator.Navigate(uri, e.Source as FrameworkElement, parameter);
            }
        }
예제 #2
0
 private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     try {
         // perform navigation using the link navigator
         LinkNavigator.Navigate(e.Uri, this, e.Target);
     } catch (Exception error) {
         // display navigation failures
         ModernDialog.ShowMessage(error.Message, UiStrings.NavigationFailed, MessageBoxButton.OK);
     }
 }
예제 #3
0
 private void OnNavigateLink(object sender, ExecutedRoutedEventArgs e)
 {
     if (LinkNavigator != null)
     {
         Uri    uri;
         string parameter;
         string targetName;
         if (FirstFloor.ModernUI.Windows.Navigation.NavigationHelper.TryParseUriWithParameters(e.Parameter, out uri, out parameter, out targetName))
         {
             LinkNavigator.Navigate(uri, e.Source as FrameworkElement, parameter);
         }
     }
 }
예제 #4
0
        private void OnNavigateLink(object sender, ExecutedRoutedEventArgs e)
        {
            if (LinkNavigator == null)
            {
                return;
            }

            Uri    uri;
            string parameter;
            string targetName;

            if (NavigationHelper.TryParseUriWithParameters(e.Parameter, out uri, out parameter, out targetName))
            {
                LinkNavigator.Navigate(uri, e.Source as FrameworkElement, parameter);
            }
        }
예제 #5
0
        private void OnNavigateTitleLink(object sender, ExecutedRoutedEventArgs e)
        {
            if (LinkNavigator == null)
            {
                return;
            }

            var titleLink = e.Parameter as TitleLink;

            if (titleLink?.GroupKey != null && !titleLink.GroupKey.Contains(@"/"))
            {
                _menu?.SwitchToGroupByKey(titleLink.GroupKey);
                return;
            }

            var eParameter = (e.Parameter as Link)?.Source ?? e.Parameter;

            if (NavigationHelper.TryParseUriWithParameters(eParameter, out var uri, out var parameter, out var _, out _))
            {
                LinkNavigator.Navigate(uri, e.Source as FrameworkElement, parameter);
            }
        }