Hyperlink in RadDiagram not working

3 posts, 1 answers
  1. Frank
    Frank avatar
    27 posts
    Member since:
    May 2011

    Posted 12 Mar 2015 Link to this post

    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
  2. Answer
    Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 12 Mar 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Frank
    Frank avatar
    27 posts
    Member since:
    May 2011

    Posted 12 Mar 2015 in reply to Kalin Link to this post

    That worked, thanks. However, I used the solution fro here: http://stackoverflow.com/a/6215696

    Regards
    Frank
Back to Top