WPF drop is not working
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
_This issue has been moved from [a ticket on Developer Community](https://developercommunity2.visualstudio.com/t/WPF-drop-is-not-working/971433)._
---
I am using Windows 10 latest version, project is in WPF .NET Framework 4.8, latest visual studio.
To make it super simple I've created a brand new WPF project. Event handlers are not called. This is the code:
<Window x:Class="WpfApp1.MainWindow"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800" AllowDrop="True">
<Grid Focusable="True" AllowDrop="True" Drop="Grid_Drop" DragOver="Grid_DragOver" DragEnter="Grid_DragEnter" PreviewDrop="Grid_PreviewDrop" PreviewDragEnter="Grid_PreviewDragEnter" PreviewDragOver="Grid_PreviewDragOver" Background="Transparent">
</Grid>
</Window>
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 WpfApp1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}private void Grid_Drop(object sender, DragEventArgs e)
{
e.Effects = DragDropEffects.Copy;
e.Handled = true;}
private void Grid_DragOver(object sender, DragEventArgs e)
{
e.Effects = DragDropEffects.Copy;
e.Handled = true;
}private void Grid_DragEnter(object sender, DragEventArgs e)
{
e.Effects = DragDropEffects.Copy;
e.Handled = true;
}private void Grid_PreviewDrop(object sender, DragEventArgs e)
{
e.Effects = DragDropEffects.Copy;
e.Handled = true;
}private void Grid_PreviewDragEnter(object sender, DragEventArgs e)
{
e.Effects = DragDropEffects.Copy;
e.Handled = true;
}private void Grid_PreviewDragOver(object sender, DragEventArgs e)
{
e.Effects = DragDropEffects.Copy;
e.Handled = true;
}
}
}
What should I do next?
---
### Original Comments
#### Feedback Bot on 4/1/2020, 10:40 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
#### Feedback Bot on 5/8/2020, 03:27 PM:
I have detected that for the last 35 days, this issue didn't have much product team activity and a very small amount of new votes or comments. Based on this, its severity, and affected area, it’s my experience that this issue is very unlikely to be fixed.
---
### Original Solutions
#### Hrvoje Batrnek solved on 5/8/2020, 04:20 PM, 0 votes:
"I have detected that for the last 35 days..."
Your detection has an error. I am waiting for the response and there was no response.
Contributor guide
Assessment
This issue has not been assessed yet.