Click Detection in a WPF Listview

Once you have the event wired up, getting the current row only takes a couple lines of code.


        private void listPictures_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            Shern.PhotoManager.Common.ImageProperty value = (Shern.PhotoManager.Common.ImageProperty)listPictures.SelectedValue;
            PictureViewer pictureViewer = new PictureViewer(value.FileName);
            pictureViewer.Show();
        }

In this example ImageProperty is the type that is bound to the ListView control.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s