RadRichTextBox WPF 中的 ContextMenu 超链接
ContextMenu Hyperlink in RadRichTextBox WPF
当我从 RadRichTextBox 的 ContextMenu 在 Hyperlink 中添加物理路径时,我看到 http:// 被额外添加,但仅在一种情况下。
- 我尝试添加如下link(文件夹名称最后没有空格),
以上给出了我正确的 URL。
- 当我添加 link 和一个最后作为空格的文件夹时,
当我编辑 Hyperlink 并查看时,我得到如下输出,
//XAML
<telerik:RadRichTextBox x:Name="ss" Grid.Column="0" Grid.Row="1" telerik:StyleManager.Theme="Windows8" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" FontWeight="Normal" AcceptsTab="True" telerik:HtmlDataProvider.Source="{Binding Notes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsSpellCheckingEnabled="True" HyperlinkClicked="ritFnBNotes_HyperlinkClicked" DocumentInheritsDefaultStyleSettings="True" Height="150" CommandExecuting="ritNotes_CommandExecuting" IsReadOnly="{Binding EnableForEdit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource InverseBool}}" DocumentContentChanged="Notes_DocumentContentChanged">
<telerik:RadRichTextBox.SelectionMiniToolBar > <telerik:SelectionMiniToolBar telerik:StyleManager.Theme="Windows8" />
</telerik:RadRichTextBox.SelectionMiniToolBar> <telerik:RadRichTextBox.Document>
<telerik:RadDocument>
<telerik:Section>
<telerik:Paragraph FontSize="8" LineSpacing="0" LineSpacingType="Exact"></telerik:Paragraph>
</telerik:Section>
</telerik:RadDocument>
</telerik:RadRichTextBox.Document>
<i:Interaction.Triggers>
<i:EventTrigger EventName="DocumentContentChanged">
<i:InvokeCommandAction Command="{Binding FnBNoteChangeCommand, Mode=OneWay}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadRichTextBox>
我不确定 http://
如何附加到我上传物理路径的 URL 中。现在我需要摆脱 http://
.
有人帮我解决这个问题。
恐怕这是 RadInsertHyperlinkDialog
的一个已知问题。当 URL 与正则表达式不匹配时,将向字符串添加 "http://"。
根据 Telerik 官方支持的建议,您可以创建一个自定义对话框来解决此问题。详情请参考以下link:http://www.telerik.com/forums/radrichtextbox-hyperlink-dialog-issue
当我从 RadRichTextBox 的 ContextMenu 在 Hyperlink 中添加物理路径时,我看到 http:// 被额外添加,但仅在一种情况下。
- 我尝试添加如下link(文件夹名称最后没有空格),
以上给出了我正确的 URL。
- 当我添加 link 和一个最后作为空格的文件夹时,
当我编辑 Hyperlink 并查看时,我得到如下输出,
//XAML
<telerik:RadRichTextBox x:Name="ss" Grid.Column="0" Grid.Row="1" telerik:StyleManager.Theme="Windows8" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" FontWeight="Normal" AcceptsTab="True" telerik:HtmlDataProvider.Source="{Binding Notes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsSpellCheckingEnabled="True" HyperlinkClicked="ritFnBNotes_HyperlinkClicked" DocumentInheritsDefaultStyleSettings="True" Height="150" CommandExecuting="ritNotes_CommandExecuting" IsReadOnly="{Binding EnableForEdit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource InverseBool}}" DocumentContentChanged="Notes_DocumentContentChanged">
<telerik:RadRichTextBox.SelectionMiniToolBar > <telerik:SelectionMiniToolBar telerik:StyleManager.Theme="Windows8" />
</telerik:RadRichTextBox.SelectionMiniToolBar> <telerik:RadRichTextBox.Document>
<telerik:RadDocument>
<telerik:Section>
<telerik:Paragraph FontSize="8" LineSpacing="0" LineSpacingType="Exact"></telerik:Paragraph>
</telerik:Section>
</telerik:RadDocument>
</telerik:RadRichTextBox.Document>
<i:Interaction.Triggers>
<i:EventTrigger EventName="DocumentContentChanged">
<i:InvokeCommandAction Command="{Binding FnBNoteChangeCommand, Mode=OneWay}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadRichTextBox>
我不确定 http://
如何附加到我上传物理路径的 URL 中。现在我需要摆脱 http://
.
有人帮我解决这个问题。
恐怕这是 RadInsertHyperlinkDialog
的一个已知问题。当 URL 与正则表达式不匹配时,将向字符串添加 "http://"。
根据 Telerik 官方支持的建议,您可以创建一个自定义对话框来解决此问题。详情请参考以下link:http://www.telerik.com/forums/radrichtextbox-hyperlink-dialog-issue