views:

37

answers:

2

I have a HyperlinkButton in a ListBox, the latter being bound to a list of items. I want the HyperLinkButton's Uri to be bound in this sort of fashion:

NavigateUri="/some/url.xaml?tag={Binding}"

Which obviously doesn't work, but you get the idea. Does anyone have a nice workaround for this? Preferably something compatible with WP7. Thanks!

+1  A: 

I would think that a value converter would be easy and give you a bit of flexibility without obscuring the xaml too much. If your URL doesn't change your in easy street, otherwise you'll need to pass in the URL to the converter, possibly from somewhere else.

Dylan
This would be a pretty neat if wordy solution. NavigateUri="{Binding Tag, RelativeSource={RelativeSource Self}, Converter={StaticResource UrlTagConverter}, ConverterParameter="/some/url.xaml"}".
Technium
A: 

Hi Will,

Peter Torr covers navigation redirection on Windows Phone 7 here quite well.

Redirecting an initial navigation - Peter Torr's Blog

An accompanying post that may also be of value.

Introducing the concept of “Places” - Peter Torr's Blog

Mick N