Open
Description
Description
The order of the menu items on WinUI can differ from iOS/Android when binding IsVisible
Steps to Reproduce
- create app with FlyoutItems
- make some of them having IsVisible bound to viewmodel bool variable (set to false)
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MauiApp1.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiApp1"
Shell.FlyoutBehavior="Flyout"
Title="MauiApp1">
<FlyoutItem FlyoutDisplayOptions="AsSingleItem"
Title="First">
<ShellContent Title="Foo"
ContentTemplate="{DataTemplate local:MainPage}">
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsSingleItem"
Title="Second">
<ShellContent Title="Foo"
ContentTemplate="{DataTemplate local:MainPage}"
IsVisible="{Binding ShowSecondMenuItem}">
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsSingleItem"
Title="Third">
<ShellContent Title="Foo"
ContentTemplate="{DataTemplate local:MainPage}">
</ShellContent>
</FlyoutItem>
</Shell>
- invert this variable value on some point (like a button click)
private void OnCounterClicked(object sender, EventArgs e)
{
WhateverModel.Instance.ShowSecondMenuItem = !WhateverModel.Instance.ShowSecondMenuItem;
}
Link to public reproduction project repository
No response
Version with bug
8.0.61 SR6.1
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
net8.0-windows10.0.19041.0
Did you find any workaround?
No response
Relevant log output
No response