I have WPF application with drag-n- drop inmplementation... Whenever I drag tree item on a Grid it is processed by DragDrop Event of that Grid, but every time it get fired twice what could be the reason ??
Below is code for implementing drag drop on treeview
void treeViewGroups_MouseMove(object sender, MouseEventArgs e)
{
try
{
if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
{
Point position = e.GetPosition(null);
if (Math.Abs(position.X - this.startPoint.X) > SystemParameters.MinimumHorizontalDragDistance || Math.Abs(position.Y - this.startPoint.Y) > SystemParameters.MinimumVerticalDragDistance)
{
DataRowView treeViewItem = this.treeViewGroups.SelectedItem as DataRowView;
if (treeViewItem != null)
if ((treeViewItem.Row.Table.TableName == "TableGroup"))
{
ViewTaxSCConstants.dragElement = treeViewItem;
Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new System.Threading.ParameterizedThreadStart(DoDragDrop), treeViewItem);
}
}
}
}