Sorry about crazy question
I’m a new wp dev using c#.
I want to know about solution to make hyperlink to another form.
Now I have listbox use data from data-source binding already.
This case same list thread of webboard and touch for link to detail.
How do I navigate from a link in a listbox to another form?
My code looks like this and I would like to make link replace textblock:
<ListBox.ItemTemplate >
<DataTemplate>
<StackPanel Margin="0,0,0,17" Width="432" Orientation="Horizontal">
<Image Source="../Media/Images/play.png" />
<StackPanel >
<TextBlock Text="{Binding Title}"
TextWrapping="Wrap"
Style="{StaticResource PhoneTextExtraLargeStyle}"/>
<TextBlock Text="{Binding ShortDescription}"
TextWrapping="Wrap" Margin="12,-6,12,0"
Visibility="{Binding ShortDescriptionVisibility}"
Style="{StaticResource PhoneTextSubtleStyle}"/>
<TextBlock Text="{Binding LongDescription}"
TextWrapping="Wrap"
Visibility="{Binding LongDescriptionVisibility}"/>
<StackPanel>
<Slider HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
Visibility="{Binding LongDescriptionVisibility}"
ValueChanged="Slider_ValueChanged"
LargeChange="0.25" SmallChange="0.05"/>
</StackPanel>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
Scenario 1: Navigating to web URLs
Lets say your data-source is having a field with URLs (lets call it NavigateToPageUrl) to which you want to navigate when user clicks on that link. In this case, inside the inner stackpanel (i.e. below the textbox binding to LongDescription) you can write following code:
Scenario 2: Navigate between forms within the same application:
In this case, you should have the Form name with you (lets say NavigateToThisForm.xaml), in this case, to any stackpanel you can add a Tag like Tag=”/navigatetothisform.xaml” and write an event handler for stack panel. Complete code will be:
I hope it helps.