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
22k stars 1.72k forks source link

FlyoutItemIsVisible property in Shell Items is always true #24797

Open gonultasmf opened 2 days ago

gonultasmf commented 2 days ago

Description

The following definition is made within the Shell:

<?xml version="1.0" encoding="UTF-8" ?>
<Shell
    x:Class="MauiApp4.AppShell"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:MauiApp4"
    Shell.FlyoutBehavior="Disabled"
    Title="MauiApp4">

    <ShellContent
        Title="Home"
        ContentTemplate="{DataTemplate local:MainPage}"
        FlyoutItemIsVisible="True"
        Route="MainPage" />

    <ShellContent
        Title="NewPage1"
        ContentTemplate="{DataTemplate local:NewPage1}"
        FlyoutItemIsVisible="False"
        Route="NewPage1" />

    <ShellContent
        Title="NewPage2"
        ContentTemplate="{DataTemplate local:NewPage2}"
        FlyoutItemIsVisible="False"
        Route="NewPage2" />

</Shell>

As you can see, only one of the ShellContent has its FlyoutItemIsVisible property set to true.

namespace MauiApp4
{
    public partial class AppShell : Shell
    {
        public AppShell()
        {
            InitializeComponent();

            var list = this.Items.Where(e => e.FlyoutItemIsVisible).ToList();
        }
    }
}

image

But when I debug the code; all ShellContent items have come to my list variable. When I examine it, the FlyoutItemIsVisible value of all items is True.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.90 SR9

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

Unfortunately

Relevant log output

No response

github-actions[bot] commented 2 days 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.