.net maui不起作用的shellcontent标签

发布于 2025-02-06 02:57:12 字数 977 浏览 2 评论 0 原文

我必须使用app.xaml,它似乎无法正常工作,这是app.xaml中的代码。

<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:NSM_Maui"
         x:Class="NSM_Maui.App">

<Application.MainPage>
    <Shell FlyoutBehavior="Flyout" FlyoutHeaderBehavior="Fixed" FlyoutVerticalScrollMode="Auto">
        <FlyoutItem Title="Home" >
            <ShellContent ContentTemplate="{DataTemplate local:HomePage}"/>
        </FlyoutItem>
    </Shell>
</Application.MainPage>

试图在.net maui中制作一个flufout菜单,从我发现的结果来看, > 但 似乎不起作用,DataTemplate字符串是一个ContentPage XAML文件,我将其称为“ HomePage”,我也在遵循此视频输入图像说明在这里

trying to make a flyout menu in .net maui, from what i found out i have to use App.xaml for it, it does not seem to be working, here is the code in App.xaml

<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:NSM_Maui"
         x:Class="NSM_Maui.App">

<Application.MainPage>
    <Shell FlyoutBehavior="Flyout" FlyoutHeaderBehavior="Fixed" FlyoutVerticalScrollMode="Auto">
        <FlyoutItem Title="Home" >
            <ShellContent ContentTemplate="{DataTemplate local:HomePage}"/>
        </FlyoutItem>
    </Shell>
</Application.MainPage>

it work fine up to the but the does not seem to be working, the Datatemplate string is a ContentPage xaml file that i made its called "HomePage" i was also following this videoenter image description here https://youtu.be/KUzpFrReJNQ

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜点 2025-02-13 02:57:12

我修复了它,我不确定我更改了什么,但我必须制作一个新项目,在appshell.xaml中有标签,您必须添加 shell.flyoutbehavior =“ flyout” ,也必须添加添加&lt; shellContent&gt; tag &lt; shellContent&gt;

i fixed it, iam not really sure what i changed but i had to make a new project and in the AppShell.xaml there is the tag and you have to add Shell.FlyoutBehavior="Flyout" and also add the <ShellContent> tag <ShellContent>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文