c# - How to get active tabbed or floating document in document group (DevExpress WPF mvvm)? -


it's me again :) making global escape shortcut application. implementation global hook , send close message in domainmodelcontext(main usercontrol scaffolding wizard). trying bad way - use code-behind. use docklayoutmanager.dockcontroller.close(docklayoutmanager.activedockitem) close tab, method close including layoutpanel :( how implement close active document tabbed , floating docs.

under document, mean view inherited singleobjectviewmodel or manually undocked

the correct way accomplish task handle closemessage @ view model level (domainmodelcontextviewmodel, believe).
@ level can use api of idocumentmanagerservice:

void onclosemessage() {     var activedocument = documentmanagerservice.activedocument;     if(activedocument != null)         activedocument.close(); } 

note: specific implementation of idocumentmanagerservice (tabbeddocumentuiservice) should registered within domainmodelcontextview.


Comments