In some cases, an element may know exactly what size it should be (because it's Width and Height properties have been explicitly set). But very often, the size of an element is determined by its content. To enable this “size to content” feature, the WPF layout engine uses a 2-pass layout cycle to size and position visual elements: 1. First a measure pass is used to determine the desired size of each element. 2. Then an arrange pass is used to explicitly size and position each element.
http://drwpf.com/blog/category/layout/