C# SplitViewTemplate,所以我得到的错误是,名称空间中不存在
本地:NavMenuItem不退出namspaceC# SplitViewTemplate,所以我得到的错误是,名称空间中不存在,c#,win-universal-app,uwp,C#,Win Universal App,Uwp,本地:NavMenuItem不退出namspace <Page x:Class="MutiViewInRootPage.AppShell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:MutiViewInRootPage"
<Page
x:Class="MutiViewInRootPage.AppShell"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MutiViewInRootPage"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:control="using:MutiViewInRootPage.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<DataTemplate x:Key="NavMenuItemTemplate" x:DataType="local:NavMenuItem">
控件:NavMenuListView不退出。。。命名空间
基于
我像SplitViewTemplate那样做了,但没有退出。。。命名空间。
我无法解决此问题。首先,请确保
NavMenuListView
的命名空间正确(人们复制代码或文件但忘记修改命名空间是很常见的):
其次,如果名称空间正确,但错误仍然存在,请尝试编译项目。有时,XAML编译器在编译之前无法识别新控件。编译后,错误将消失
如果错误仍然存在,请通过在线存储库共享项目好吗
更新:我下载了演示项目,并尝试构建整个项目。并发现未实现NavMenuList\u ItemInvoked。因此,我在代码隐藏中添加了以下代码:
<control:NavMenuListView x:Name="NavMenuList"
Grid.Row="1"
ItemsSource="{x:Bind NavList}"
ContainerContentChanging="NavMenuItemContrinerContentChanging"
ItemInvokded="NavMenuList_ItemInvoked"
ItemTemplate="{StaticResource NavMenuItemTemplate}"/>
然后构建成功了 在链接的存储库中没有提到
NavMenuListView
。所以我用了不同的名字,但代码是一样的。结果是,NavMenuList\u itemscalled
没有实现。编写一个空的eventhandler并再次构建解决了这个问题。
private void NavMenuList_ItemInvoked(object sender, ListViewItem e){}