0

あるページから別のページへのリダイレクト中に、次の例外に直面しています。

タイプ 'Microsoft.Phone.Shell.PhoneApplicationService' のインスタンスを作成できません [行: 38 位置: 23]

最初のページの下のコード:

NavigationService.Source = (new Uri("/SecondPage.xaml?selectedItem=" + myId, UriKind.RelativeOrAbsolute));

上記の uri の助けを借りて、2 番目のページを呼び出しています。stackOverflow で提供されているいくつかのソリューションによると、xaml ページに問題があり、xaml ページのコードの下に貼り付けています。

SupportedOrientations="PortraitOrLandscape"
shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded"
tools:TiltEffect.IsTiltEnabled="True" Orientation="Portrait" >
<phone:PhoneApplicationPage.Resources>
    <shell:ApplicationBar x:Key="SettingsBar" IsVisible="True"  Mode="Default">
        <shell:ApplicationBarIconButton x:Name="btnHome"  IconUri="Images/home.png" Text="home"  Click="btnHome_Click" />
        <shell:ApplicationBarIconButton x:Name="cot" IconUri="Images/toc.png" Text="toc"  Click="btnToc_Click"/>
        <shell:ApplicationBarIconButton x:Name="zoom" IconUri="Images/zoom.png" Text="zoom" Click="btnZoom_Click"/>
        <shell:ApplicationBarIconButton x:Name="setting" IconUri="Images/settings.png" Text="settings" Click="btnSettings_Click" />
        <shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarMenuItem x:Name="SettingBar_wb" Click="AppMenu_wb_Click" Text="See Wordbank" />
            <shell:ApplicationBarMenuItem x:Name="SettingBar_sn" Click="AppMenu_sn_Click" Text="See Notes, " />
            <shell:ApplicationBarMenuItem x:Name="SettingBar_hight" Click="AppMenu_hight_Click" Text="See Highlight" />
        </shell:ApplicationBar.MenuItems>
    </shell:ApplicationBar>
    <shell:ApplicationBar x:Key="AnnotatorBar" IsVisible="True" >
        <shell:ApplicationBarIconButton x:Name="notes"  IconUri="Images/notes.png" Text="note"  Click="btnNote_Click" />
        <shell:ApplicationBarIconButton x:Name="myhights" IconUri="Images/myghights.png" Text="highlight"  Click="btnHighlight_Click"/>
        <shell:ApplicationBarIconButton x:Name="definsed" IconUri="Images/definesed.png" Text="Define" Click="btnDefine_Click"/>
        <shell:ApplicationBarIconButton x:Name="webs" IconUri="Images/webs.png" Text="wordbank" Click="btnWordbank_Click" />
        <shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarMenuItem x:Name="AppMenu_SeeWordBank" Click="AppMenu_SeeWordBank_Click" Text="See Wordbank" />
            <shell:ApplicationBarMenuItem x:Name="AppMenu_SeeNotes" Click="AppMenu_SeeNotes_Click" Text="See Notes, " />
            <!--following is line 38 -->
            <shell:ApplicationBarMenuItem x:Name="AppMenu_SeeHighlights" Click="AppMenu_SeeHighlights_Click" Text="See Highlight" />
        </shell:ApplicationBar.MenuItems>
    </shell:ApplicationBar>
</phone:PhoneApplicationPage.Resources>

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

App.g.cs で直面している例外

System.Windows.Application.LoadComponent(this, new System.Uri("/dbok;component/App.xaml", System.UriKind.Relative));
4

1 に答える 1