开发者

Silverlight xaml: building/concatenating Uris or other strings

开发者 https://www.devze.com 2023-01-11 04:56 出处:网络
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:

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开发者_StackOverflow anyone have a nice workaround for this? Preferably something compatible with WP7. Thanks!


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消