Example #1
0
        /// <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);
        }
Example #2
0
        /// <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)
        {
            if (m_hyperLinkToUrl.ContainsKey(sender))
            {
                string link = m_hyperLinkToUrl[sender];

                OnMarkdownLinkTappedArgs eventArgs = new OnMarkdownLinkTappedArgs()
                {
                    Link = link
                };

                m_onMarkdownLinkTapped.Raise(this, eventArgs);
            }
        }
 /// <summary>
 /// Fired when a link is tapped in the markdown.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MarkdownBlock_OnMarkdownLinkTapped(object sender, OnMarkdownLinkTappedArgs e)
 {
     App.BaconMan.ShowGlobalContent(e.Link);
 }
Example #4
0
 private async void MarkdownTextBlock_OnMarkdownLinkTapped(object sender, UniversalMarkdown.OnMarkdownLinkTappedArgs e)
 {
     var dialog = new MessageDialog($"Link clicked: {e.Link}");
     await dialog.ShowAsync();
 }
        /// <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)
        {
            if (m_hyperLinkToUrl.ContainsKey(sender))
            {
                string link = m_hyperLinkToUrl[sender];

                OnMarkdownLinkTappedArgs eventArgs = new OnMarkdownLinkTappedArgs()
                {
                    Link = link
                };

                m_onMarkdownLinkTapped.Raise(this, eventArgs);
            }
        }
        /// <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);
        }