Suppose you want to allow a user to re-size a WPF/SL Grid containing two columns. But you also want to allow the user to hide one column (a "panel") or the other column. When both columns (panels) are shown, the GridSplitter should be also be shown; otherwise not. You also want to use MVVM-style bindings without code-behind. And maybe you want to persist the settings between sessions. You have these properties in your view-model:
bool IsPanelOneVisible
bool IsPanelTwoVisible
GridLength SplitPosition
So how can I wire this up using only bindings?
Note that a grid column's width (set either via binding or to Auto) gets overridden when the user drags the GridSplitter.
None of the posts that I've perused (which also include a couple of SplitContainer implementations) address this scenario head on. One could wire this up using code-behind (in response to events) or additional properties on the view-model. But I was hoping for a more elegant solution.
Any ideas? Thanks!