MenuItem CreateNonVisibleMenuItem() { MenuItem item = new MenuItem(); FlyoutItem.SetIsVisible(item, false); return(item); }
public async Task FlyoutItemVisible() { var shell = new Shell(); var item1 = CreateShellItem <FlyoutItem>(shellItemRoute: "NotVisible"); var item2 = CreateShellItem(); shell.Items.Add(item1); shell.Items.Add(item2); FlyoutItem.SetIsVisible(item1, false); Assert.IsTrue(GetItems(shell).Contains(item1)); bool hasFlyoutItem = (shell as IShellController) .GenerateFlyoutGrouping() .SelectMany(i => i) .Contains(item1); Assert.IsFalse(hasFlyoutItem); }