Hi guys. I’m just passing-along another playground that I once saw.
(someone else playing with sub-menus).
In general, this might be a job for GUI “Grid Control”.
Let’s call this thing… a “treeMenu”. I THINK… if you use a gridControl to make a drill-able treeMenu… then ALL of your buttons (cells) must have the same height (grid row height). AND… all of the buttons in any “sub-menu” (branch menu)… must have the same width. (grid column width)
You’ll need a type of “grid manager”… active… which uses NO stackPanels at all. It always uses grid cells, instead. It needs to watch for clicks, and determine where sub-menus need to happen, and be able to fill (and clear) cells in any column and row. It will build branches that LOOK-LIKE stackpanels, but are not such. Instead… the manager is “stocking” (and clearing) grid cells.
Keep in mind that buttons are simply JS objects, and can be stored in arrays… just as easily as they can be stored in gui containers. They are easy to “wrangle”(a herding thing) and organize into hot-swappable groups (a cattle-drive thing).
I THINK… a gridControl and custom gridCell manager… will give you full power for treeMenu’s. No promises, though. I have never tried stack-less drill-menus with a gridControl… but it sounds like fun.