2016-04-11 12 views
0

私は、ユーザーがアイスクリームを注文できるWindowsアプリケーションを開発しています。 「logorder」と呼ばれる別のページに移動するためのボタンを作成しようとしていますが、エラーが発生しています。エラーを表示するために画像をアップロードしました。 Click here for the image他のWindows phoneページへの移動エラー

コード

Public NotInheritable Class MainPage 
Inherits Page 

Public Property NavigationService As Object 


''' <summary> 
''' Invoked when this page is about to be displayed in a Frame. 
''' </summary> 
''' <param name="e">Event data that describes how this page was reached. 
''' This parameter is typically used to configure the page.</param> 
Protected Overrides Sub OnNavigatedTo(e As Navigation.NavigationEventArgs) 
    ' TODO: Prepare the page for display here. 

    ' TODO: If your application contains multiple pages, ensure that you are 
    ' handling the hardware Back button by registering for the 
    ' Windows.Phone.UI.Input.HardwareButtons.BackPressed event. 
    ' If you are using the NavigationHelper provided by some templates, 
    ' this event is handled for you. 

End Sub 

Private Sub HyperlinkButton_Click(sender As Object, e As RoutedEventArgs) 

End Sub 

Private Sub button_Copy_Click(sender As Object, e As RoutedEventArgs) Handles button_Copy.Click 

    NavigationService.Navigate(New Uri("/logorder.xaml", UriKind.Relative)) 


End Sub 
End Class 

XAML ...

<Page 
x:Class="mobileapps.MainPage" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:mobileapps" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d" 
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 

<Grid> 
    <Button x:Name="button_Copy" Content="Summary"  HorizontalAlignment="Left" Margin="96,425,0,0" VerticalAlignment="Top" Width="191"/> 
    <HyperlinkButton Content="HyperlinkButton" HorizontalAlignment="Left" VerticalAlignment="Top"/> 
    <HyperlinkButton Content="HyperlinkButton" HorizontalAlignment="Left" Margin="-232,186,0,0" VerticalAlignment="Top"/> 
    <HyperlinkButton Content="HyperlinkButton" HorizontalAlignment="Left" VerticalAlignment="Top"/> 
    <HyperlinkButton Content="HyperlinkButton" HorizontalAlignment="Left" VerticalAlignment="Top"/> 
    <HyperlinkButton Content="Log order" HorizontalAlignment="Left" Margin="134,332,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.106,-0.496" Click="HyperlinkButton_Click" NavigateUri="logorder.xaml"/> 
    <HyperlinkButton NavigateUri="logorder.xaml" /> 

</Grid> 

+0

あなたのコードをここにスニペットの代わりに、画像を追加し、 – Eldho

+0

は、適切な方法をナビゲートするために与えられたページのパスですか? – Archana

+0

可能な複製http://stackoverflow.com/q/4660142/50447 –

答えて

0

あなたはNavigationServiceを設定していないが、あなたはNullReferenceException

を取得しますので、それに対してメソッドを呼び出そうと決して
+0

参照のみが必要です –

関連する問題