Hello.
Before, i am using Prism, Catel and AD.
I wan't to save and load Layout without breaking MVVM logic, with out accessing View from ViewModel.
Before i used CommandBindings to achieve it, but now, i declare menu and DockingManager in different files, so i have some how access parent to add CommandBinding to it. It's not good.
I am using only 1 DM in my app and, cause of i have to create commands at startup, even if window is not created, i've create WorkspaseService which have methods:
But what to do with saving and loading i dont know.
I think I can with AttachedProperty or with Behavior bind DockingManager to property in ViewModel, so i can save and load layout from VM? bet i don't know how and don't found any article how to do this.
Is there some way to create some Service to access all DockingManagers created in Application by name, it would awesome, i think.
Before, i am using Prism, Catel and AD.
I wan't to save and load Layout without breaking MVVM logic, with out accessing View from ViewModel.
Before i used CommandBindings to achieve it, but now, i declare menu and DockingManager in different files, so i have some how access parent to add CommandBinding to it. It's not good.
I am using only 1 DM in my app and, cause of i have to create commands at startup, even if window is not created, i've create WorkspaseService which have methods:
CreateTool(Type)
CloseTool(Type)
So each new Tool(anchorable) can create command in MenuService with commandvar workspace = GetService<IWorkspace>();
var menu = GetService<IMenu>();
const string path = "Views";
var showToolCmd = new Command<Type>(workspace.ShowTool);
menu.RegisterMenu(new MenuItemNode(path) {Text = "Assets View", Command = showToolCmd, CommandParameter = typeof(AssetView), Group = viewGroup});
It is not good solution, but it works for me.But what to do with saving and loading i dont know.
I think I can with AttachedProperty or with Behavior bind DockingManager to property in ViewModel, so i can save and load layout from VM? bet i don't know how and don't found any article how to do this.
Is there some way to create some Service to access all DockingManagers created in Application by name, it would awesome, i think.