Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Hyperlink doesn't respond to clicks?

 
 
Old 03-18-2006   #1 (permalink)
Chris Sammis


 
 

Hyperlink doesn't respond to clicks?

Using the Feb. CTP:

A component of my application converts HTML coming in from a socket to XAML
using a series of regular expressions, and calls the XamlReader.Load(string)
method to turn the XAML into a Paragraph object, which is then inserted into
a RichTextBox.

HTML hyperlinks, <a href="http://url.com">MyUrl</a>, get translated into the
XAML expression <Hyperlink NavigateUri="http://url.com">MyUrl</Hyperlink>. A
full Paragraph might look like: <Paragraph xmlns="..."
xml:space="preserve">Go to this keen site: <Hyperlink NavigateUri="...">My
Site</Hyperlink>!</Paragraph>

The RTB displays everything very nicely, but the hyperlink doesn't behave
"normally." The text color is not the default hyperlink color, although it
is a different color from the rest of the RTB text and is underlined. The
cursor does not change to a "hyperlink" cursor when the user mouses over it.
But most importantly, the hyperlink doesn't respond to clicks at all.
Attempting to circumnavigate this by adding a Click="hyperlink_click" event
handler in the XAML results in the parser throwing an exception, saying that
the XAML must be compiled (and not parsed, I guess?)

Any advice for getting operable hyperlinks?

My System SpecsSystem Spec
Old 03-21-2006   #2 (permalink)
Nick Kramer [MSFT]


 
 

Re: Hyperlink doesn't respond to clicks?

Yeah, there's compiled xaml, then there's XamlReader.Load, and the latter
doesn't support events because there's no obvious code to hook them up to.

That doesn't explain why hyperlinks can't be clicked, though, can you send
us a repro file? Thanks.

-Nick Kramer [MSFT]

---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Chris Sammis" <ChrisSammis@discussions.microsoft.com> wrote in message
news:B16B336A-5093-4010-B2BC-0AD372ABABDE@microsoft.com...
> Using the Feb. CTP:
>
> A component of my application converts HTML coming in from a socket to
> XAML
> using a series of regular expressions, and calls the
> XamlReader.Load(string)
> method to turn the XAML into a Paragraph object, which is then inserted
> into
> a RichTextBox.
>
> HTML hyperlinks, <a href="http://url.com">MyUrl</a>, get translated into
> the
> XAML expression <Hyperlink NavigateUri="http://url.com">MyUrl</Hyperlink>.
> A
> full Paragraph might look like: <Paragraph xmlns="..."
> xml:space="preserve">Go to this keen site: <Hyperlink NavigateUri="...">My
> Site</Hyperlink>!</Paragraph>
>
> The RTB displays everything very nicely, but the hyperlink doesn't behave
> "normally." The text color is not the default hyperlink color, although
> it
> is a different color from the rest of the RTB text and is underlined. The
> cursor does not change to a "hyperlink" cursor when the user mouses over
> it.
> But most importantly, the hyperlink doesn't respond to clicks at all.
> Attempting to circumnavigate this by adding a Click="hyperlink_click"
> event
> handler in the XAML results in the parser throwing an exception, saying
> that
> the XAML must be compiled (and not parsed, I guess?)
>
> Any advice for getting operable hyperlinks?



My System SpecsSystem Spec
Old 03-21-2006   #3 (permalink)
Chris Sammis


 
 

Re: Hyperlink doesn't respond to clicks?

Not a problem - what's the best way to send what you need? It's a bit lengthy
to repost a reproduction in its entirety on the newsgroup.

As a workaround, I came up with the idea of iterating through the
Paragraph's Inline objects looking for hyperlinks and manually attaching a
MouseDown event (Click still doesn't work). This works for the most part,
but iterating through all the top-level inlines doesn't touch every hyperlink
that have been buried in formatting. What's a good way to visit every Inline
in a Block?
My System SpecsSystem Spec
Old 03-21-2006   #4 (permalink)
Ifeanyi Echeruo [MSFT]


 
 

Re: Hyperlink doesn't respond to clicks?

Are there any NavigationWindow or Frame elements in the parent chain of the
Hyperlink?
Hyperlink initiates navigation by bubbling a navigation routed event through
its parent chain.
If an element in the parent chain (usually NavigationWindow or Frame)
handles the event then navigation happens otherwise noop.

-- Ifeanyi Echeruo [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.

"Chris Sammis" <ChrisSammis@discussions.microsoft.com> wrote in message
news:0D03FFFB-D8DF-46A0-BC00-3FE5656E8E63@microsoft.com...
> Not a problem - what's the best way to send what you need? It's a bit
> lengthy
> to repost a reproduction in its entirety on the newsgroup.
>
> As a workaround, I came up with the idea of iterating through the
> Paragraph's Inline objects looking for hyperlinks and manually attaching a
> MouseDown event (Click still doesn't work). This works for the most part,
> but iterating through all the top-level inlines doesn't touch every
> hyperlink
> that have been buried in formatting. What's a good way to visit every
> Inline
> in a Block?



My System SpecsSystem Spec
Old 03-21-2006   #5 (permalink)
Nick Kramer [MSFT]


 
 

Re: Hyperlink doesn't respond to clicks?

Probably best to file on ladybug,
http://lab.msdn.microsoft.com/productfeedback/

In terms of enumerating all hyperlinks, I believe you can do this using
LogicalTreeHelper.

-Nick Kramer [MSFT]

---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Chris Sammis" <ChrisSammis@discussions.microsoft.com> wrote in message
news:0D03FFFB-D8DF-46A0-BC00-3FE5656E8E63@microsoft.com...
> Not a problem - what's the best way to send what you need? It's a bit
> lengthy
> to repost a reproduction in its entirety on the newsgroup.
>
> As a workaround, I came up with the idea of iterating through the
> Paragraph's Inline objects looking for hyperlinks and manually attaching a
> MouseDown event (Click still doesn't work). This works for the most part,
> but iterating through all the top-level inlines doesn't touch every
> hyperlink
> that have been buried in formatting. What's a good way to visit every
> Inline
> in a Block?



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
clicks Vista mail
Mouse clicks Vista hardware & devices
start menu does not respond to clicks Vista General
Tip of Pen Right-Clicks instead of Clicking Vista hardware & devices
Tip of Pen Right-Clicks instead of Clicking Vista hardware & devices


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46