Imagine I have two WPF FrameworkElements that need to be laid out. One element contains text, and the other shows line numbers for the text.
The widths of these two elements are not independent. For example, if the text element gets narrower, then more lines may wrap, which increases the number of lines, which may cause the line number element to grow wider (e.g. if the number of lines goes from 99 to 100). But if the line number element grows wider, then there's less space for the text element, etc.
How do I implement layout in WPF if the sizes of my child elements need to be calculated in concert with one another? I am new to WPF layout, but it looks like a fundamental assumption of MeasureOverride is that an element's size can be calculated without regard to the sizes of peers.
Thanks for any help.