Ejemplo n.º 1
0
        void drag_OnStartDrag(object sender, MouseEventArgs e)
        {
            try
            {
                // Get the dragged ListViewItem
                ListViewItem item = VisualHelper.FindAnchestor <ListViewItem>((DependencyObject)e.OriginalSource);

                if (item != null)
                {
                    object associatedData = this.ItemContainerGenerator.ItemFromContainer(item);

                    // Find the data behind the item + Initialize the drag & drop operation
                    DataObject dragData = new DataObject(DragAndDropID, associatedData);
                    _drager.DoDragDrop(dragData, item);
                }
            }
            catch (Exception err)
            {
                LogHelper.Manage("ExtendedlistView:drag_OnStartDrag", err);
            }
        }