Solved

Reading text off of ((((System.Windows.Documents.Hyperlink)(e.OriginalSource as FrameworkContentElement))))

Posted on 2010-09-02
6
429 Views
Last Modified: 2013-12-17
Experts I need to do get the text off of System.Windows.Documents.Hyperlink on my win form. What do i do ? I am using it in WPF ? So i do the following

((((System.Windows.Documents.Hyperlink)(e.OriginalSource as FrameworkContentElement)))).Text

But get an error saying the get is inaccessible .....
0
Comment
Question by:dotnetpro
  • 4
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
jhshukla earned 500 total points
ID: 33592217
What's the point of casting plus as-operator? you need only one. Seems like you are more interested in the Hyperlink class. Have you tried NavigateUri?
http://msdn.microsoft.com/en-us/library/system.windows.documents.hyperlink.navigateuri.aspx
0
 
LVL 1

Author Comment

by:dotnetpro
ID: 33596160
that is also coming in as null
0
 
LVL 1

Author Comment

by:dotnetpro
ID: 33596170
I am looking to read the hyperlinked text on my form. So if "Click here" is hyperlink i want to read "Click here" in my code.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 9

Expert Comment

by:jhshukla
ID: 33614558
I see. I misunderstood your question.
Perhaps you would want to try ContentStart or ContentEnd and corresponding methods.
http://msdn.microsoft.com/en-us/library/system.windows.documents.textpointer_methods.aspx
0
 
LVL 1

Author Comment

by:dotnetpro
ID: 33618156
You know i was able to do this myself. I had to cast the "Tag" property of the HyperLink to one of our custom navigation objects and there by reading a custom property. But i appreciate your help.
0
 
LVL 1

Author Closing Comment

by:dotnetpro
ID: 33618210
The answer was not useful to me at all, but i appreciate the time expert took to answer my question.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question