I am trying to create a nice drag and drop zone in WPF that appears in the adorner layer when something is being dragged into the main application. The problem is that I do not receive any events from my fan, although according to the documentation he should receive all input events, since he is in a higher z-order.
To debug my problem, I created a really simple example when I have a user control that has only a button. This user control is displayed at the adorner level, but I cannot click a button. What for? What did I do wrong?
My adorner class is constructed as follows:
public ShellOverlayAdorner(UIElement element, AdornerLayer adornerLayer)
:base(element)
{
_adornerLayer = adornerLayer;
_overlayView = new AdornedElement();
_overlayView.AllowDrop = true;
_adornerLayer.Add(this);
}
and is created in the main window
private void Window_Loaded(object sender, RoutedEventArgs e)
{
adornerLayer = AdornerLayer.GetAdornerLayer(MyTopGridWithButtonInIt);
ShellOverlayAdorner shell = new ShellOverlayAdorner(MyTopGridWithButtonInIt, adornerLayer);
}
- , .. , , . adorner. ?