Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With Xamarin.Forms 5 I get "XLS0504 'Items' does not support values of type 'ArrayExtension (Array)'" in XAML #2

Open
thomiel opened this issue Aug 20, 2022 · 1 comment

Comments

@thomiel
Copy link

thomiel commented Aug 20, 2022

in MainPage.xaml:

            <controls:ContextMenuButton.Items>
                <x:Array Type="{x:Type MenuItem}">
                    <MenuItem Text="Command 1"/>
                    <MenuItem Text="Command 2"/>
                    <MenuItem Text="Command 3"/>
                </x:Array>
            </controls:ContextMenuButton.Items>
@thomiel
Copy link
Author

thomiel commented Aug 20, 2022

Wondering what happened to the Array extension in Xamarin.Forms 5...

I'm now adding the menu items programatically using <controls:ContextMenuButton x:Name="menu" and
` this.InitializeComponent();

        var items = new List<MenuItem>();
        items.Add(new MenuItem()
        {
            Text = "Command 1"
        });
        items.Add(new MenuItem()
        {
            Text = "Command 2"
        });
        items.Add(new MenuItem()
        {
            Text = "Command 3"
        });
        menu.Items = items;

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant