Beispiel #1
0
 private void DockIconContainer_Drop(object sender, DragEventArgs e)
 {
     if (!e.Data.GetDataPresent(DataFormats.FileDrop))
     {
         return;
     }
     if (dragItem != null && dragIndex > 0 && VMLocator.Main.SaveAutomatically)
     {
         dragItem.Pinned = true;
         container.SaveSettings();
     }
     EndDrag();
 }
Beispiel #2
0
 private void MouseReleased(Point pos)
 {
     if (draggedIcon == null || !MouseDown)
     {
         return;
     }
     MouseDown = false;
     if (IsDragging)
     {
         if (container.IsPositionWithinBounds(pos))
         {
             draggedIcon.Info.Pinned = true;
             PlaceDraggedIcon();
         }
         else
         {
             AnimationTools.FadeOut(0.2, draggedIconImage, 0, () => canvas.Children.Remove(draggedIconImage));
             if (draggedIcon.Windows.Any())
             {
                 DockIcon icon = new DockIcon(draggedIcon.Info);
                 foreach (Window w in draggedIcon.Windows)
                 {
                     icon.Windows.Add(w);
                 }
                 icon.Info.Pinned = false;
                 container.Children.Add(icon);
             }
         }
         if (SettingsManager.Settings.SaveAutomatically)
         {
             container.SaveSettings();
         }
     }
     else
     {
         draggedIcon.Run();
     }
     Dispose();
     container.ReleaseMouseCapture();
 }