I have the following layout for a screen displaying multi-channel information (similar to audio tracks):
MultiChannelPlotterControl
contains oneHorizontalRuler
instance at the bottom and aUniformGrid
containing NSingleChannelPlotterControl
instances;- Each
SingleChannelPlotterControl
has one instance ofVerticalRuler
aligned to left;
Problems are:
- Each vertical ruler can have a different Width, but I would like them all to stretch to the largest width so that they could fit, but since they are on different controls, I cannot put them in the same container (another
UniformGrid
, for example. Now if I decide to put them together in a different container, they would not be part of theSingleChannelPlotterControl
anymore; - There is a rectangular region on the bottom left corner. That is supposed to have the same Width of the VerticalRuler(s), but it is still higher in the layout tree. It is currently empty, but I could put something there and bind its Width, for example;
So the question is:
How could I Layout/Element-Bind/Style these controls so that right edge of the Vertical Rulers keep aligned to each other (fitting the widest one) and with the left edge of the Horizontal Ruler?
EDIT:
I guess I could create a "LeftPanelWidth" DependencyProperty on MultiChannelPlotterControl
, and on its getter use some VisualTreeHelper
wizardry to get ActualWidths for every VerticalRuler inside, but how would I choose the largest width and set the widths of the others?