简体   繁体   中英

navigation in itemtemplate with querystring wp7

I have a ListBox.ItemTemplate in ListBox inside wp7 app. What I want is to navigate to somepage when user clicks the title with titletext in querystring.

Currently it just navigates to somepage.

 <ListBox x:Name="lbname"  >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Background="White">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" />
                        </Grid.RowDefinitions>
                        <TextBlock x:Name="tbTitle" Grid.Row="0" Text="{Binding Title}" TextAlignment="Left"   FontFamily="Segoe WP" Foreground="#000000" Style="{StaticResource PhoneTextTitle1Style}" >
                            <Custom:Interaction.Triggers>
                                <Custom:EventTrigger EventName="MouseLeftButtonDown">
                                    <ic:NavigateToPageAction TargetPage="/Views/somePage.xaml"/>
                                </Custom:EventTrigger>
                            </Custom:Interaction.Triggers>
                        </TextBlock>
                        <TextBlock  x:Name="tbDesc" Grid.Row="1" Margin="11,0,0,0" Text="{Binding Desc}" TextAlignment="Left"  FontFamily="Segoe WP" Foreground="#000000" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" />
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

How to do that?

如何设置TargetPage =“ {Binding Address}”?

我将HyperlinkButtonNavigateUri="{Binding NavigationURL}"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM