title: WPF - Best Practice for the run-of-the-mill [Label:Input] Control
body: <p>I am wondering, which is the best and quickest way to get the well known Label Input [or output, doesn't matter] combination in WPF. Its a simple Task, just think of a quick output of the "object" ME:</p>
  
  <hr>
  
  <p>Name - Christian</p>
  
  <p>Age  - 28</p>
  
  <p>Mood - Good</p>
  
  <hr>
  
  <p>I know, I can use a Grid with TextBlocks. But to be honest, the "short" XAML for this is nearly half a page long (RowDefinitions, ColDefs, Grid.Col on each Label)</p>
  
  <p>The alternative way, using three StackPanels (horizontal) with one vertical seems also a little bit stupid. In this case, I have to give each Label a fixed width, to get the indent correct. And it just does not "feel" right.</p>
  
  <p>So, given the Situation above, you got a custom object with 3-6 Properties you just want to dump as readonly to your GUI, how would you do it (in WPF, Silverlight too, if you are really in the mood :).</p>
  
  <p>I can, of course, write a usercontrol for this. But why reinvent the wheel, if it might be already there...  </p>
  
  <p>And finally, to illustrate even further, the example I just created in real life and was the reason for this post:</p>
  
  <pre><code>      &lt;StackPanel&gt;
          &lt;StackPanel Orientation="Horizontal"&gt;
              &lt;TextBlock Text="Log Count"  Width="100"/&gt;
              &lt;TextBlock Text="{Binding LastLogRun.LogMessageCount}"/&gt;
          &lt;/StackPanel&gt;
          &lt;StackPanel Orientation="Horizontal"&gt;
              &lt;TextBlock Text="Start Time" Width="100"/&gt;
              &lt;TextBlock Text="{Binding LastLogRun.StartTime}"/&gt;
          &lt;/StackPanel&gt;
          &lt;StackPanel Orientation="Horizontal"&gt;
              &lt;TextBlock Text="End Time" Width="100"/&gt;
              &lt;TextBlock Text="{Binding LastLogRun.EndTime}"/&gt;
          &lt;/StackPanel&gt;
      &lt;/StackPanel&gt;
  </code></pre>