コントロールにアクセスできるように、Windows RT XAML Toolkitを使用しようとしていますTreeView
。次のような XAML を含む MainPage を含む新しい BlankApp を作成しました。
<Page
x:Class="BlankApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BlankApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
</Grid>
</Page>
Page
これをに変更したいWinRTXamlToolkit.Controls.AlternativePage
。XAML を次のように変更しました。
<xc:AlternativePage
x:Class="BlankApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xc="using:WinRTXamlToolkit.Controls"
xmlns:local="using:BlankApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
</Grid>
</xc:AlternativePage>
MainPage クラスをWinRTXamlToolkit.Controls.AlternativePage
ではなく拡張するように変更しましたPage
。
アプリを起動すると、次のステートメントで失敗します。
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
「初期ページの作成に失敗しました」と表示されますが、詳細が表示されません。
Navigate
私の質問は次のとおりです。 1.通話が失敗する理由の詳細を確認するにはどうすればよいですか を追加してみましrootFrame.NavigationFailed += rootFrame_NavigationFailed;
たが、ナビゲーション失敗イベントが発生していないようです。2. ページを適切に使用するにはどうすればよいWinRTXamlToolkit.Controls.AlternativePage
ですか?