gpt4 book ai didi

maui - .Net Maui - ShellContent 导航问题

转载 作者:行者123 更新时间:2023-12-03 08:01:13 27 4
gpt4 key购买 nike

我正在尝试导航到“TestView”页面,该页面位于 VisualStudio 解决方案的“Views”文件夹中。这里编译错误。

错误 XFC0000 无法解析类型“:TestView”

AppShell.xaml 文件

<FlyoutItem Title="test" FlyoutIcon="List">

<ShellContent
Title="Test Page"
ContentTemplate="{DataTemplate local:TestView}"
Route="TestView" />
</FlyoutItem>

需要帮助解决编译错误

这里是我的 GitHub 项目的链接 MPC-Calculator Maui Branch

enter image description here

最佳答案

将 shell 中的命名空间更改为:

xmlns:local="clr-namespace:MPC_MassPropertiesCalculator_MAUIapp"

对此:

xmlns:local="clr-namespace:MPC_MassPropertiesCalculator_MAUIapp.Views"

基本上,如果您想在 XAML 中引用 View ,您需要拥有其确切的命名空间,然后是 View 的名称。

关于maui - .Net Maui - ShellContent 导航问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74126082/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com