1
votes

My WPF Window uses AvalonDock to arrange different layouts. In one layout I have something similar to FileManager control. Inside FileManager control there is a standard WPF TreeView control. In FileManager control I want to allow users to drag and drop files from Windows explorer. However, when I drag files from explorer to my AvalonDock window it shows me disabled icon - no matter if I go over FileManager control or any other layout in window. Had tried to add AllowDrop on every element in VisualTree (including window, Avalon docking manager, Grids, etc.) When I inspect my window in runtime (with SnoopUI and WPF Inspector) I see that all layouts do have "AllowDrop" set to true!

Here is inspecting window in runtime with Snoop:

enter image description here

It is as my window somehow disables Drag and Drop functionality (from other programs) no matter what I set on controls and templates in AvalonDock layouts.

Is there a way to enable drag and drop of files from other programs in AvalonDock enabled application?

2

2 Answers

0
votes

nothing to do with avalon...you have to manage the drop event :

private void RibbonWindow_Drop(object sender, DragEventArgs e)

and all drag events enter, leave, over

look at this and this

0
votes

As a matter of fact, problem has nothing to do with AvalonDock and WPF. My application needs to run as administrator. Windows blocks any application running under different user privileges to drag and drop - security feature of Windows...

More info:

Visual Studio 2010 WPF Project ran in debug or relase will not allow drag and drop to any control

Why my WPF application has Drag & Drop disabled (even when AllowDrop is true)?