views:

71

answers:

1

In my page I want the button that looks like the HyperlinkButton (underline when MouseOver etc). But I want to handle the navigation in code (by using the Click event handler). So I'm using a HyperlinkButton and setting the NavigateUri to an empty string and setting the Click handler.

But the problem is that the browser tried to download the entire .xbap as a file download, presumably the empty NavigateUri mean "root".

Is there any way I can re-use the HyperLinkButton class (for visuals) but perform the actual navigation / or action in the Click method.

+1  A: 
  1. Open expression blend.
  2. Right click on hyperlink button -> Edit style -> Edit copy
  3. Change TargetType="HyperlinkButton" to TargetType="Button"
  4. Use this style with any button.

Also, I have no problem with code

<HyperlinkButton Content="HyperlinkButton" Click="hb_Click"/>
vorrtex
That code is what I have in my project and it's no working. ;>
will
Ok, download expression blend.
vorrtex
@will: vorrtex is correct. If you have no NavigateUri property at all **(not an *empty* string)** it will not navigate and you can simply add a click handler.
Enough already
OK, removing the NavigateUri property worked. Thanks guys, v much appreciated.
will