コード例 #1
0
 /// <inheritdoc/>
 protected internal override void OnPointerPressed(PointerPressedEventArgs e)
 {
     if (!e.Handled && LinkIsClickable(e.KeyModifiers))
     {
         var eventArgs = new OpenUriRoutedEventArgs(NavigateUri)
         {
             RoutedEvent = OpenUriEvent
         };
         e.Source.RaiseEvent(eventArgs);
         e.Handled = true;
     }
 }
コード例 #2
0
        private static void ExecuteOpenUriEventHandler(Window window, OpenUriRoutedEventArgs arg)
        {
            var url = arg.Uri.ToString();

            try
            {
                Process.Start(new ProcessStartInfo
                {
                    FileName        = url,
                    UseShellExecute = true
                });
            }
            catch (Exception)
            {
                // Process.Start can throw several errors (not all of them documented),
                // just ignore all of them.
            }
        }