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

MenuItem not working on GridView #16

Open
maxchu92 opened this issue Jan 10, 2018 · 1 comment
Open

MenuItem not working on GridView #16

maxchu92 opened this issue Jan 10, 2018 · 1 comment

Comments

@maxchu92
Copy link

It seems like the MenuItem is not working with the GridView on iOS or Android. Not yet implement the feature? Thanks.
'
var vcTemplate = new GridViewXamlCell {
View = new StackLayout {
Padding = new Thickness(8, 8),
Children = {
new Label{Text="test"}
}
}
};
var miDelete = new MenuItem { Text = "Delete", IsDestructive = true };
miDelete.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
miDelete.Clicked += (sender, e) => {
var mi = ((MenuItem)sender);
System.Diagnostics.Debug.WriteLine("Delete Context Action clicked: " + mi.CommandParameter);
};
vcTemplate.ContextActions.Add(miDelete);

`

@NobsterTheLobster
Copy link
Owner

Yeah looking at the Xamarin.Forms repo it appears that CellAdapter is where the contextmenu support has been added by implementing ActionMode.ICallback. In Xamarin.Forms the ListViewAdapter inherits from CellAdapter but in this repo the GridViewAdapter is inheriting from RecyclerView.Adapter. I'll have a think about implementing ActionMode.ICallback in my own adapter but I can't promise anything.

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

No branches or pull requests

2 participants