|
I need to do a simple drag and drop procedure, but I dont know why this code isn´t working...
MainWindow.XAML:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApplication13
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void img_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Image img = (Image)sender;
DataObject dataObj = new DataObject(img);
DragDrop.DoDragDrop(img, dataObj, DragDropEffects.Move);
}
private void target_Drop(object sender, DragEventArgs e)
{
Image img = (Image)e.Data.GetData(typeof(Image));
Utes.Children.Remove(img);
Nivel1.Children.Add(img);
}
private void img_MouseMove(object sender, MouseEventArgs e)
{
}
private void img_DragLeave(object sender, DragEventArgs e)
{
e.Effects = DragDropEffects.Move;
}
Please... any advice will be appreciated!.
|
|
|
|
|
You need to give some info on symptoms of the issues, not just give a code dump saying 'this doesn't work, please fix it for me'.
My advice? Well debug it dear Liza, dear Liza...
|
|
|
|