Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Why TextBlock with HyperLink is not disabling?

$
0
0

Hi, I have a strange situation. I decide to add the hyperlink to my wpf window. When my app is starting, this window should be disabled, to avoid undesirable user clicks. And here is the magic - TextBlock with HyperLink within is not disabling! It's active within disabled window! How it's possible?!!

Here the code:

<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    Title="" Height="200" Width="200" WindowStartupLocation="CenterScreen" IsEnabled="False" ><Grid><StackPanel Margin="0,0,0,4" Orientation="Horizontal"><TextBlock x:Name="About" HorizontalAlignment="Right" Margin="0,10,30,0" TextWrapping="Wrap" VerticalAlignment="Top"><Hyperlink NavigateUri="A" RequestNavigate="Test" ><InlineUIContainer><TextBlock Text="TEST"/></InlineUIContainer></Hyperlink></TextBlock></StackPanel><Button Content="Button" HorizontalAlignment="Left" Height="40" Margin="0,47,0,0" Grid.Row="1" VerticalAlignment="Top" Width="176"/></Grid></Window>

And code behind:

Class MainWindow 
    Sub Test()
        MsgBox("Hello World!")
    End Sub

    Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
        Me.IsEnabled = False
    End Sub
End Class


Aleksey



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>