Yep, you are missing the subtle difference between the two.
In MeasureOverride
, the parent asks the child how big it wants to be.
In ArrangeOverride
, the parent tells the child how much space it actually has and where it is being placed.
It is like budget or review time at your work: your boss asks you how much money you want, then laughs and tells you how much you will actually get and when. Like the child control, you then have to do your best with what you are given.
To put a little perspective on this, one of the key points of WPF is scalable UI. Much like the boss/employee scenario above, the needs of the parent/child control need to be kept in balance. Just because a child control requests a certain size, that doesn't mean the parent control has that space to give, so that needs to be communicated to the child. OTOH, with the increasing size of monitors your child may end up with considerably more real estate than what it really needs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…