Windows phone 7 单击app.xaml.cs页面中的布局时如何导航到另一个页面?

Windows phone 7 单击app.xaml.cs页面中的布局时如何导航到另一个页面?,windows-phone-7,windows-phone-7.1,Windows Phone 7,Windows Phone 7.1,在图钉布局中单击箭头时如何导航到另一页 App.xaml页面代码: <Application.Resources> <Style x:Key="MenuItemsStyle" TargetType="sltkit:MenuItem"> <Setter Property="Template"> <Setter.Value> <Cont

在图钉布局中单击箭头时如何导航到另一页

App.xaml页面代码:

<Application.Resources>
        <Style x:Key="MenuItemsStyle" TargetType="sltkit:MenuItem">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="sltkit:MenuItem">
                        <StackPanel>
                            <TextBlock Text="{Binding Name}" 
                                       TextWrapping="Wrap" 
                                       Margin="24,0" 
                                       FontSize="26"/>
                            <TextBlock Text="{Binding Description}" 
                                       TextTrimming="WordEllipsis" 
                                       Margin="24,0" 
                                       FontSize="22"/>
                            <TextBlock Text="{Binding DatetimeAdded}" 
                                       TextTrimming="WordEllipsis" 
                                       Margin="24,0" 
                                       FontSize="22"/>
                            <Image  Source="/MyBuddies;component/Images/decline.png" Height="20" Width="20" Margin="200,0" Stretch="Fill" Name="imgDecline"  >
                            </Image>
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="MenuStyle" TargetType="sltkit:ContextMenu">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border CornerRadius="8" Margin="24" 
                               BorderBrush="Green" BorderThickness="2">
                            <Border.Background>
                                <LinearGradientBrush 
                                   StartPoint="0.5,0" EndPoint="0.5,1">
                                    <GradientStop Color="White" 
                                                 Offset="0.0"/>
                                    <GradientStop Color="LightBlue" 
                                                 Offset="0.5"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <ItemsPresenter />
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>

in mainpage.xaml 

<my:MapItemsControl.ItemTemplate>
                        <DataTemplate>
                         <my:Pushpin
                          Background="Blue"
                           Location="{Binding Location}" Tap="Pushpin_Tap">
                                <sltkit:ContextMenuService.ContextMenu>
                                    <sltkit:ContextMenu IsZoomEnabled="False">
                                        <sltkit:MenuItem Style="{StaticResource MenuItemsStyle}"/>
                                    </sltkit:ContextMenu>
                                </sltkit:ContextMenuService.ContextMenu>
                            </my:Pushpin>
                        </DataTemplate>
                    </my:MapItemsControl.ItemTemplate>
                </my:MapItemsControl>

在mainpage.xaml中

点击显示说明的图钉。点击时需要在该布局中放置一个箭头,将一些值传递到另一页。如何实现此目的?请告诉我…

在App.xaml中编写一些UI代码不是一个好的做法。App.xaml和App.xaml.cs用于处理应用生命周期事件,如启动、关闭、激活和停用事件,并用于共享一些全局数据

如果您仍然想使用,那么在代码隐藏中,您可以使用以下代码从App.xaml导航到另一个页面

(Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/AnotherPage.xaml", UriKind.RelativeOrAbsolute));