Exemplo n.º 1
0
        private void panel_MouseMove(object sender, MouseEventArgs e)
        {
            try
            {
                if (_mouseDownOn == null)
                {
                    return;
                }

                // Start Drag
                ImageFilters.DragDataObject dragObject = new ImageFilters.DragDataObject(_mouseDownOn.Item2, _mouseDownOn.Item1, _kernels[_mouseDownOn.Item2]);
                DataObject dragData = new DataObject(DATAFORMAT_MYKERNEL, dragObject);
                DragDrop.DoDragDrop(_mouseDownOn.Item1, dragData, DragDropEffects.Move);

                _mouseDownOn = null;        // this way another drag won't start until they release and reclick
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        private void panel_MouseMove(object sender, MouseEventArgs e)
        {
            try
            {
                if (_mouseDownOn == null)
                {
                    return;
                }

                // Start Drag
                ImageFilters.DragDataObject dragObject = new ImageFilters.DragDataObject(_mouseDownOn.Item2, _mouseDownOn.Item1, _kernels[_mouseDownOn.Item2]);
                DataObject dragData = new DataObject(DATAFORMAT_MYKERNEL, dragObject);
                DragDrop.DoDragDrop(_mouseDownOn.Item1, dragData, DragDropEffects.Move);

                _mouseDownOn = null;        // this way another drag won't start until they release and reclick
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }