I'm having some trouble getting this to work in a WPF app I'm working on. Basically, what I'm after is something like the Task pane in an MMC:
I'm trying to do as much as possible in XAML and with binding.
And can I have it topped with cream, ice cream and chocolate chips, please? :-)
As I read your requirements, instead of thinking of a Grid
, I think of a DockPanel
.
<DockPanel>
<Grid Name="right"
DockPanel.Dock="Right" MinWidth="100" />
<Grid Name="Left"
DockPanel.Dock="Left" MinWidth="100" />
<Grid Name="middle" />
</DockPanel>
If you make a way to resize right
, then middle
will change as right
is resized. If you resize the window, only middle
will change. Storing and setting the Width
of right
is up to you, but shouldn't be hard.
As for allowing the user to resize right
, that will a bit trickier, but I found this article that should help. This other article might help even more.
For the visibility of right
, you can set its Visibility
to Collapsed
to hide it and restore it by setting it to Visible
.
Note: The panels inside don't have to be Grid
s, but you will want to use some sort of Panel
for each. Whatever you have inside your current Grid
columns should work just fine.