Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1770
saving/loading of layout using mvvm
posted

Hello. I have 2 questions.

I'm using a xamoutlook bar. One of the outlookbar groups has the dock manager. The others have different content. So when they click on a different outlookbar group the content gets swapped out.

<ContentControl  Content="{Binding CurrentViewModel}" Grid.Row="1" Grid.Column="1"/>

So say someone rearranges the all the panes in the dockmanager then clicks on a different outlookbar group then clicks back to the one with the dock manager. The layout resets to what is defined statically in the xaml. In order to remember what the layout was I'm assuming that I will have to save the layout every time a bar group other then the one with the dock manager gets click to remember how the user left the layout. Is this correct or is there some other way of doing this without saving to a file? I'm asking cause I'm not closing the application just swapping the content in ContentControl.

Second question.

When I save a layout I need to get a handle of the DockManager. How can I do this if I'm using the mvvm pattern? Would I somehow bind to the DockManager like binding to properties? I could do it in a code behind since I can directly reference the DockManager. So a button click would trigger an event which would trigger the saveLayout method but then I'm breaking the mvvm pattern.

Thanks

Parents Reply Children