dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.97k stars 1.71k forks source link

FlyoutItemIsVisible doesn't work for nested content #23720

Open LeoKhariton opened 1 month ago

LeoKhariton commented 1 month ago

Description

The official Microsoft documentation says:

There's also a Shell.FlyoutItemIsVisible attached property, which can be set on FlyoutItem, MenuItem, Tab, and ShellContent objects.

However, this does not work for nested elements. image

Steps to Reproduce

  1. Create a new MAUI project.
  2. Replace the code in the AppShell.xaml file with

    <?xml version="1.0" encoding="UTF-8" ?>
    <Shell
    x:Class="MauiApp2.AppShell"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:MauiApp2"
    Shell.FlyoutBehavior="Disabled"
    Title="MauiApp2">
    
    <FlyoutItem>
        <ShellContent
            Title="Home"
            ContentTemplate="{DataTemplate local:MainPage}" />
    
        <ShellContent
            Title="Home"
            ContentTemplate="{DataTemplate local:MainPage}"
            FlyoutItemIsVisible="False"/>
    
    </FlyoutItem>
    </Shell>
  3. Despite the fact that the second ShellContent element has the FlyoutItemIsVisible="False" property, it is still displayed in the tab bar panel.

Link to public reproduction project repository

No response

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.