I pulled a lot of hairs out of my almost bald head today trying to figure this out. I have a layout to create in WPF which involves a top panel and a bottom panel. Both the top and bottom panel can expand and collapse. If I collapse the top panel, the bottom panel should fill the remaining space. If I collapse the bottom panel, the top panel should fill the remaining space.
The only way I found to set what is going to fill remaining space with the dockpanel is the LastChildFill property. This is a boolean which determines if the last child should fill the remaining space or not. This, of course, doesn't work for me. I want to be able to specify which child will fill. I need the top to fill when the bottom is collapsed, and the bottom to fill when the top is collapsed.
There may be a better way to do this than my solution, but since I'm constrained with only the last child being able to fill, I had to change the order of the items in the children collection.
dkpRight.Children.Remove(child);
dkpRight.Children.Add(child);
So, when the top collapsed I would remove the bottom and add the bottom thus making it the last child. Likewise, when the bottom collapsed I remove the top and add the top.
Seems like a hack to me, is there a better way?
posted on Saturday, September 15, 2007 3:40 PM
Feedback
# re: How to Set the Fill Child in a WPF DockPanel
6/15/2008 9:43 PM |
You should have a rest for a while.
# re: How to Set the Fill Child in a WPF DockPanel
6/15/2008 9:44 PM |
Have a nice weekend to get rid of these boring things!
# re: How to Set the Fill Child in a WPF DockPanel
6/15/2008 9:47 PM |
So, when the top collapsed I would remove the bottom and add the bottom thus making it the last child. Likewise, when the bottom collapsed I remove the top and add the top.
:)
# re: How to Set the Fill Child in a WPF DockPanel
6/25/2008 4:06 AM |
With a slicker storytelling pace that puts down more emphasis on it’s plotting and
action (and it’s grotesque hentai angle which works well here), but don’t think it
http://shikarno.info/index.php?sm=2
lags on the sex because while it comes in short bites these bites are fairly mango
dispersed about the title and it all flows together well.
# re: How to Set the Fill Child in a WPF DockPanel
6/25/2008 4:06 AM |
Add to that it’s unique
visual style and the fact we’re looking at a work from the “creator” of the whole
http://prihodis.info/index.php?sm=2
“erotic grotesque” style and anime you can see why this is a 5 out of 5. Breakdown will
prove that out.
# re: How to Set the Fill Child in a WPF DockPanel
6/25/2008 4:07 AM |
This week it's Lord Kaosu by himself again, hell. I throw out the big thanks to Anime Pulse for their drawing program we used in the last contest. Also check out this Sneak King video sent in by Exorc. Hello Kitty Time Hello Kitty Stump Village not in stores Hello Kitty USB video (from sledge) Hentai Reviews Random J-Porn Free Hentai Ultra Passwords (from Abz) Dojinshi (from Brandee) Hentai News Gpod
http://mistoru.com/index.php?sm=1 Waterless Toilets Maid Attacks on the Rise LAN Party.