I've take the 91213 version and have developed your MVVM test application beyond recognition (I incorporated AvalonEdit and made a few (mostly housekeeping) changes in your initial test app
- see ChangeHistory.txt in Version2.0\AvalonDock\AvalonDock.MVVMTestApp
in attached zip for more details.
The FileViewModel works great and I am pretty close to finishing up on this one. I have found and fixed a few bugs in that area (see ChangeHistory.txt). In the implementation I am stuck with the Copy, Cut, Paste, and Delete commands.
In AvalonEdit these commands can only be executed at the view control (for performance reasons).
1.1) Using these commands as they were designed by Daniel through ApplicationCommands.Cut etc.. works until I undock a document[?] (see ToolBar in MainWindow.xaml).
1.2) I have tried to solve this problem through a custom command and a VisualTreeHelper function (MainWindow.xaml, Workspace_Commands.cs) but that resulted in the same issue. Everythings fine until a document is undocked.
Does the dockManager have any API to resolve situations in 1.1 and 1.2?
1.1 seems to exist because a RoutedUICommand is executed but never passed to the undocked content.
For 1.2 I simply could not find a function that provides a way for accessing undocked content.
Comments: ** Comment from web user: dirkster **
Hi Ado,
the reported problem can still be verified in the newest build. Please compile the attached source and start AvalonDockEdit.
1> Open a file (eg.: *.cs)
2> Select text and try an editing function in the toolbar (eg.: Cut)
3> Drag the document out of the Window
4> retry the function in 2>
1.2 Issue:
The custom routed command is not enabled (since CanExecute is never called) and can thus not be executed.
The behaviour is slightly different when you change the custom commands to using WPF's standard commands
(eg.: use ApplicationCommands.Delete as discussed in MainWindow.xml)
To verify this you have to adjust
MainWindow.xaml and
InitEditCommandBinding (method) in Workspace_Command.cs
1.1 Issue:
The commands work fine as long as the document is docked.
The commands are enabled when the document is undocked but clicking a button (with text selected)
does not result in executing the command.
I also noticed that I can select text, undock the document, and the text selection is lost.
Maybe thats a related problem?
Please find attached a version for build 91549