1、动态隐藏CS代码实现
mainwindow.xaml
<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">
<Grid Name= "systemGrid">
</Grid>
</Window>
mainwindow.xaml.cs
TextBlock tbRun = new TextBlock { FontSize = 14d, Foreground = Brushes.Blue };
Run run = new Run("百度一下");
Hyperlink hyperl = new Hyperlink(run);
hyperl.TextDecorations = null; //隐藏超链接下划线
hyperl.NavigateUri = new Uri("https://www.baidu.com");
hyperl.RequestNavigate