/// <summary>
        /// Fired when a user taps one of the link elements
        /// </summary>
        private async void Hyperlink_Click(Hyperlink sender, HyperlinkClickEventArgs args)
        {
            // Links that are nested within superscript elements cause the Click event to fire multiple times.
            // e.g. this markdown "[^bot](http://www.reddit.com/r/youtubefactsbot/wiki/index)"
            // Therefore we detect and ignore multiple clicks.
            if (multiClickDetectionTriggered)
            {
                return;
            }

            multiClickDetectionTriggered = true;
            await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => multiClickDetectionTriggered = false);

            // Get the hyperlink URL.
            var url = (string)sender.GetValue(HyperlinkUrlProperty);

            if (url == null)
            {
                return;
            }

            // Fire off the event.
            var eventArgs = new LinkClickedEventArgs(url);

            LinkClicked?.Invoke(this, eventArgs);
        }
Exemplo n.º 2
0
        public void OnHref(Hyperlink sender, HyperlinkClickEventArgs e)
        {
            var value = sender.GetValue(HrefClickParam);

            switch (value)
            {
            case string strValue:
                if (strValue.StartsWith("/u/"))
                {
                    App.AppViewModel.HomeContentFrame.Navigate(typeof(UserProfile), strValue.Replace("/u/", ""));
                }
                break;
            }
            // TODO: f**k
        }
Exemplo n.º 3
0
        private static void onLinkRequestNavigate(object sender, RequestNavigateEventArgs args)
        {
            if (!ReferenceEquals(sender, args.OriginalSource))
            {
                return;
            }

            if (ObservableObject.IsInDesignMode)
            {
                return;
            }

            Hyperlink link = sender as Hyperlink;

            ICommand command = link?.GetValue(RequestNavigationCommandProperty) as ICommand;

            if (command != null && command.CanExecute(args))
            {
                command.Execute(args);
            }
        }
Exemplo n.º 4
0
 private void HyperLinkActions(IGingerWebElement element, eElementAction mElementAction)
 {
     if (element is IHyperLink Hyperlink)
     {
         if (element is IClick ClickElement)
         {
             ClickActions(ClickElement, ElementAction);
         }
         else
         {
             switch (mElementAction)
             {
             case eElementAction.GetValue:
                 AOVs.Add(new NodeActionOutputValue()
                 {
                     Param = "Actual", Value = Hyperlink.GetValue()
                 });
                 break;
             }
         }
     }
 }
Exemplo n.º 5
0
 public static bool GetNavigateExternally(Hyperlink element)
 {
     return((bool)element.GetValue(NavigateExternallyProperty));
 }
 /// <summary>
 /// Gets the <see cref="CommandProperty"/> instance associated with the specified <see cref="Windows.UI.Xaml.Documents.Hyperlink"/>
 /// </summary>
 /// <param name="obj">The <see cref="Windows.UI.Xaml.Documents.Hyperlink"/> from which to get the associated <see cref="CommandProperty"/> value</param>
 /// <returns>The <see cref="CommandProperty"/> value associated with the <see cref="Windows.UI.Xaml.Documents.Hyperlink"/> or null</returns>
 public static object GetCommandParameter(Hyperlink obj) => obj.GetValue(CommandParameterProperty);
 /// <summary>
 /// Gets the <see cref="ICommand"/> instance associated with the specified <see cref="Windows.UI.Xaml.Documents.Hyperlink"/>
 /// </summary>
 /// <param name="obj">The <see cref="Windows.UI.Xaml.Documents.Hyperlink"/> from which to get the associated <see cref="ICommand"/> instance</param>
 /// <returns>The <see cref="ICommand"/> instance associated with the <see cref="Windows.UI.Xaml.Documents.Hyperlink"/> or null</returns>
 public static ICommand GetCommand(Hyperlink obj) => (ICommand)obj.GetValue(CommandProperty);
 /// <summary>
 /// Fired when a user taps one of the link elements
 /// </summary>
 private void Hyperlink_Click(Hyperlink sender, HyperlinkClickEventArgs args)
 {
     LinkHandled((string)sender.GetValue(HyperlinkUrlProperty), true);
 }
        /// <summary>
        /// Fired when a user taps one of the link elements
        /// </summary>
        private void Hyperlink_Click(object sender, RoutedEventArgs args)
        {
            Hyperlink hyperlink = (Hyperlink)sender;

            LinkHandled((string)hyperlink.GetValue(HyperlinkUrlProperty), true);
        }
 /// <summary>
 /// Gets the <see cref="CommandProperty"/> instance assocaited with the specified <see cref="Hyperlink"/>
 /// </summary>
 /// <param name="obj">The <see cref="Hyperlink"/> from which to get the associated <see cref="CommandProperty"/> value</param>
 /// <returns>The <see cref="CommandProperty"/> value associated with the the <see cref="Hyperlink"/> or null</returns>
 public static object GetCommandParameter(Hyperlink obj)
 {
     return(obj.GetValue(CommandParameterProperty));
 }
 /// <summary>
 /// Gets the <see cref="ICommand"/> instance assocaited with the specified <see cref="Hyperlink"/>
 /// </summary>
 /// <param name="obj">The <see cref="Hyperlink"/> from which to get the associated <see cref="ICommand"/> instance</param>
 /// <returns>The <see cref="ICommand"/> instance associated with the the <see cref="Hyperlink"/> or null</returns>
 public static ICommand GetCommand(Hyperlink obj)
 {
     return((ICommand)obj.GetValue(CommandProperty));
 }
Exemplo n.º 12
0
 public static bool GetLaunchHyperlink(Hyperlink element)
 {
     return((bool)element.GetValue(LaunchHyperlinkProperty));
 }
Exemplo n.º 13
0
 public static bool GetIsPressed(Hyperlink hyperlink)
 {
     return((bool)hyperlink.GetValue(IsPressedProperty));
 }
 public static string GetWebUrl(Hyperlink element)
 {
     return((string)element.GetValue(WebUrlProperty));
 }
        /// <summary>
        /// Fired when a user taps one of the link elements
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void Hyperlink_Click(Hyperlink sender, HyperlinkClickEventArgs args)
        {
            // Links that are nested within superscript elements cause the Click event to fire multiple times.
            // e.g. this markdown "[^bot](http://www.reddit.com/r/youtubefactsbot/wiki/index)"
            // Therefore we detect and ignore multiple clicks.
            if (multiClickDetectionTriggered)
                return;
            multiClickDetectionTriggered = true;
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.High, () => multiClickDetectionTriggered = false);

            // Get the hyperlink URL.
            var url = (string)sender.GetValue(HyperlinkUrlProperty);
            if (url == null)
                return;

            // Fire off the event.
            var eventArgs = new OnMarkdownLinkTappedArgs()
            {
                Link = url
            };
            m_onMarkdownLinkTapped.Raise(this, eventArgs);
        }