Пример #1
0
        private void mouseDown(object sender, MouseButtonEventArgs e)
        {
            Image img = sender as Image;

            if (img != null)
            {
                Point           mousePos = e.GetPosition(null);
                Point           position = ActionBrosser.PointToScreen(new Point(0d, 0d));
                DoubleAnimation da       = new DoubleAnimation();
                //Trace.WriteLine("PosX= " + mousePos.X + " PosY = " + mousePos.Y);
                //Trace.WriteLine("ImagePosX= " + position.X + " ImagePosY = " + position.Y);
                t = true;
            }
        }
Пример #2
0
 private void List_MouseMove(object sender, MouseEventArgs e)
 {
     if (t)
     {
         Point           mousePos = e.GetPosition(null);
         Point           position = ActionBrosser.PointToScreen(new Point(0d, 0d));
         DoubleAnimation da       = new DoubleAnimation();
         //Trace.WriteLine("PosX= " + mousePos.X + " PosY = " + mousePos.Y);
         //Trace.WriteLine("ImagePosX= " +position.X + " ImagePosY = " + position.Y);
         // Get the dragged ListViewItem
         Image      img  = sender as Image;
         DataObject data = new DataObject(typeof(ImageSource), img.Source);
         DragDrop.DoDragDrop(img, data, DragDropEffects.Move);
     }
 }