This is a migrated thread and some comments may be shown as answers.

Hyperlink in RadDiagram not working

4 Answers 136 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 12 Mar 2015, 10:02 AM
Hi,

I'm using Q1 2015 with .NET 4.

The Hyperlink in the ContentTemplate of the DiagramShape is not working. If you remove the BusyIndicator the Hyperlink works.

<Window x:Class="Hyperlink.MainWindow"
        Title="MainWindow"
        Height="350"
        Width="525">
    <Grid>
        <telerik:RadBusyIndicator>
            <telerik:RadDiagram IsEditable="False"
                                SelectionMode="None">
                <telerik:RadDiagramShape>
                    <telerik:RadDiagramShape.ContentTemplate>
                        <DataTemplate>
                            <TextBlock>
                                <Hyperlink NavigateUri="http://www.telerik.com"
                                           RequestNavigate="OnNavigate">
                                    <TextBlock Text="Telerik"></TextBlock>
                                </Hyperlink>
                            </TextBlock>
                        </DataTemplate>
                    </telerik:RadDiagramShape.ContentTemplate>
                </telerik:RadDiagramShape>
            </telerik:RadDiagram>
        </telerik:RadBusyIndicator>
    </Grid>
</Window>

using System.Diagnostics;
using System.Windows;
using System.Windows.Navigation;
 
namespace Hyperlink
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void OnNavigate(object sender, RequestNavigateEventArgs e)
        {
            Process.Start(e.Uri.AbsoluteUri);
            e.Handled = true;
        }
    }
}

Thanks
Frank

4 Answers, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 12 Mar 2015, 01:41 PM
Hi Frank,

We are already aware of the explained issue and it is caused by a framework behavior. The problem is that Hyperlink's IsEnabled property is not changing whenever the IsEnabled of its parents is changed. The solution is to bind IsEnabled of the Hyperlink to IsEnabled of its parent. For more details regarding the issue you can check the following article:
http://siderite.blogspot.com/2011/06/wpf-hyperlinks-and-isenabled-mystery.html

Please test the suggestion and let us know if you have any other issues.


Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Frank
Top achievements
Rank 1
answered on 12 Mar 2015, 02:39 PM
That worked, thanks. However, I used the solution fro here: http://stackoverflow.com/a/6215696

Regards
Frank
0
Costin
Top achievements
Rank 1
answered on 14 Jan 2020, 03:33 PM
The URL for the solution is now https://siderite.dev/blog/how-to-draw-outlined-text-in-wpf-and.html. Thanks, Kalin for recommending it.
0
Dilyan Traykov
Telerik team
answered on 15 Jan 2020, 12:00 PM

Hello,

I believe the article Kalin referenced has been moved to the following location: https://siderite.dev/blog/wpf-hyperlinks-and-isenabled-mystery.html/

I do hope this solution works for you.

Regards,
Dilyan Traykov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
BusyIndicator
Asked by
Frank
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Frank
Top achievements
Rank 1
Costin
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or