Solved

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

Posted on 2010-09-02
6
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

630 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