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

Carousel ItemClick #48

Closed
mashabek opened this issue Sep 6, 2016 · 2 comments
Closed

Carousel ItemClick #48

mashabek opened this issue Sep 6, 2016 · 2 comments

Comments

@mashabek
Copy link

mashabek commented Sep 6, 2016

I was terribly upset that Carousel, ResponsiveGridView controls don't provide ItemClick event. It give us ItemClickCommand, but there is no need in it, because it I don't know what item was clicked. Will ItemClick event be available in near future?

@javitosanchez
Copy link
Collaborator

The controls you mentioned use the ICommand approach instead ItemClick approach. If you want to handle the item click event you have to expose a ICommand property in your viewModel. You can use the RelayCommand implementation that gives you the clicked item. For example:

public RelayCommand<ItemViewModel> ItemClickCommand
{
    get
    {
        return new RelayCommand<ItemViewModel>(
        (item) =>
        {
            // do whatever with your item
        });
    }
}

@mashabek
Copy link
Author

mashabek commented Sep 8, 2016

That's great! I thought there is no CommandParameter, because Carousel provide only Command, but it seems included in ItemClickCommand.

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

2 participants