开发者

Preventing Hyperlink inside WPF RichTextbox from being edited by end user

开发者 https://www.devze.com 2023-04-01 06:08 出处:网络
I am having a WPf hyperlink inside a WPf Richtextbox , clicking on hyperlink results in opening ofa popup.

I am having a WPf hyperlink inside a WPf Richtextbox , clicking on hyperlink results in opening of a popup. But i wish to prevent the editing of hyperlink text.

Initially it looks like below

Preventing Hyperlink inside WPF RichTextbox from being edited by end user

but when user edits the hyperlink it looks like this

Preventing Hyperlink inside WPF RichTextbox from being edited by end user

So I wish to prevent this editing o开发者_高级运维f hyerlink.


If you add in a container it cannot be edited (but removed as a whole):

<InlineUIContainer>
    <TextBlock>
        <Hyperlink NavigateUri="http://www.google.com/">
            <Run Text="Google"/>
        </Hyperlink>
    </TextBlock>
</InlineUIContainer>

Would this be any good?

0

精彩评论

暂无评论...
验证码 换一张
取 消