Exemplo n.º 1
0
 private void AssociatedObject_Loaded(object sender, RoutedEventArgs e)
 {
     if (!(sender is Panel panel))
     {
         return;
     }
     if (panel.Background == null)
     {
         panel.Background = Brushes.Transparent;
     }
     panel.AllowDrop  = true;
     panel.DragEnter += new DragEventHandler(AssociateObject_DragEnter);
     panel.DragOver  += new DragEventHandler(AssociatedObject_DragOver);
     DragManager.RegisterDragContext(panel, AssociatedObject_DropCompleted);
 }