I'm attempting to use Windows RT XAML Toolkit so that I can have access to the TreeView
control. I've created a new BlankApp that contains a MainPage containing XAML similar to this:
<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>
I want to change this Page
to an WinRTXamlToolkit.Controls.AlternativePage
. I've modified the XAML to be:
<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>
And modified the MainPage class to extend WinRTXamlToolkit.Controls.AlternativePage
rather than Page
.
Now when I launch my app, It fails in the following statement:
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");
}
}
I receive the "Failed to create initial page", but not more details.
So my questions would be:
1. How can I find out more details on why the Navigate
call is failing? I tried adding rootFrame.NavigationFailed += rootFrame_NavigationFailed;
, but the navigation failed event does not seem to be getting raised.
2. How can I properly use the WinRTXamlToolkit.Controls.AlternativePage
page?