Windows Phone 8.1 NavigationService.navigate无法正常工作

法科

我对NavigationService有问题。当我单击按钮时,我的应用程序总是结束,而不必将其重定向到另一个页面。我在项目中多次使用NavigationService,并且效果很好,仅在这种情况下不起作用。

这是我的XAML:

<phone:PhoneApplicationPage
x:Class="FaceDetectionEx.FaceDetection"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
mc:Ignorable="d"
xmlns:CamControl="clr-namespace:FaceDetectionEx"
shell:SystemTray.IsVisible="False">

<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Margin="0,10,0,21"  MouseLeftButtonDown="cameraViewer_MouseLeftButtonDown_1" MouseLeftButtonUp="cameraViewer_MouseLeftButtonUp_1">

        <CamControl:CameraViewer x:Name="cameraViewer">


        </CamControl:CameraViewer>

        <Canvas x:Name="cnvsFaceRegions" Width="480" Height="800" HorizontalAlignment="Center" VerticalAlignment="Center">

        </Canvas>

        <StackPanel x:Name="sck_Mask" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12,0,12,0" Width="600">
            <TextBlock x:Name="cameraResolution" Visibility="Collapsed" TextWrapping="Wrap" Text="" FontSize="30"></TextBlock>
        </StackPanel>

    </Grid>
    <Grid>
        <Button Content="Back to Menu"  Background="Black" HorizontalAlignment="Left" Margin="279,718,0,0" VerticalAlignment="Top" Visibility="Visible" Click="Button_Click_1" Width="201"/>
    </Grid>
</Grid>

private void Button_Click_1(object sender, RoutedEventArgs e)
    {                     
        NavigationService.Navigate(new Uri("/MyFaceDetection;component/MainPage.xaml", UriKind.RelativeOrAbsolute));                  
    }

谢谢你的建议。

Umesh kamble

在Windows Phone 8.1中,“页面导航”方法是:

Frame.Navigate(typeof(MainPage));

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Windows Phone 8开发:OpenStreamForWriteAsync无法正常工作吗?

在Windows Phone 8上平移无法正常工作

在WPF Windows Phone 8中销毁上一页(NavigationService.GoBack())

Windows Phone VB“未声明NavigationService”

Windows Phone开发中找不到NavigationService类命名空间

Windows Phone 8的密码锁定屏幕下快速应用程序恢复无法正常工作

jQuery mobile $ .mobile.changePage()Windows Phone 8无法正常工作Cordova / PhoneGap

以下代码在Windows Phone 8中正常工作,但是当我转换为Windows Phone 8.1时,NavigationContext无法正常工作

如何确定Windows Phone 8(.1)上的蓝牙是否打开

Windows Phone 8记录

Windows Phone 8的LockScreen

Windows Phone应用程序导航错误:当前上下文中不存在NavigationService

Windows Phone模拟器无法正常工作

HttpClient PCL在Windows Phone上无法正常工作

_wfopen_s在Windows Phone应用中无法正常工作

无法在Windows Phone 8应用中安装Windows Azure SDK

Windows Phone 8 MonoGame项目停止工作

旧游戏在Windows 8中无法正常工作/ Windows 8中的旧游戏无法正常运行

HTML页面无法在Windows Phone 8中滚动

无法在WebBrowser控件中上传文件-Windows Phone 8

无法在Windows Phone 8中设置多个辅助磁贴

无法在Windows Phone 8中使用SaveJpeg方法(NotSupportedException)

Windows Phone 8上的“无法安装公司应用”

“ Windows Phone Silverlight 8”是否与“ Windows Phone 8”相同?

滚动浏览Windows Phone 8

Windows Phone 8应用提交

集成adtech Windows Phone 8

Windows Phone 8中的NavigationDrawer

从代码锁定Windows Phone 8