Reputation: 263
I'm trying to make a navigation view with MUXC in my app but is donesn't work:
Error XDG0062: Failed to set "Content".
XAML Code:
<Page
x:Class="XizSoft.Views.Pages.TestPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XizSoft.Views.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<muxc:NavigationView x:Name="nvSample9"
Header="This is Header Text"
PaneDisplayMode="Left"
IsSettingsVisible="False">
<muxc:NavigationView.MenuItems>
<muxc:NavigationViewItem Content="Browse" Tag="SamplePage1" Icon="Library" />
<muxc:NavigationViewItem Content="Track an Order" Tag="SamplePage2" Icon="Map" />
<muxc:NavigationViewItem Content="Order History" Tag="SamplePage3" Icon="Tag" />
</muxc:NavigationView.MenuItems>
<muxc:NavigationView.FooterMenuItems>
<muxc:NavigationViewItem Content="Account" Tag="SamplePage4" Icon="Contact" />
<muxc:NavigationViewItem Content="Your Cart" Tag="SamplePage5" Icon="Shop" />
<muxc:NavigationViewItem Content="Help" Tag="SamplePage5" Icon="Help" />
</muxc:NavigationView.FooterMenuItems>
<Frame x:Name="contentFrame9" />
</muxc:NavigationView>
</Page>
Target: Universal Windows version 2004 Min. Target: Universal Windows version 1809
Does anyone knows how to solve this? Is this a problem in my code or in the platform?
Upvotes: 1
Views: 1611
Reputation: 11
Add following xaml code into App.xaml will solve your problem.
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
</Application.Resources>
Upvotes: 1
Reputation: 475
Normally this is not required but have you tried to encapsulate your frame in the Content property of your NavigationView ?
<muxc:NavigationView.Content>
<Frame x:Name="contentFrame9" />
</muxc:NavigationView.Content>
With the Target and MinTarget SDK, my app successfully display your page :
I have referenced the last version of Microsoft.UI.Xaml library :
Upvotes: 1