How to retrieve hyperlink url from selection text in wpf?
WPF
1
Posts
1
Posters
0
Views
1
Watching
-
trying to copy and paste text containing hyperlink from one richtextbox to another with TextPointer position as parameter. tried using the following code but couldn't figure out what the problem is. it did not work.
private Hyperlink GetHyperlinkAncestor(TextPointer position)
{
Inline parent = position.Parent as Inline;
while (parent != null && !(parent is Hyperlink))
{
parent = parent.Parent as Inline;
}
return parent as Hyperlink;
}- Regards -
J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers