title: Putting an icon at the right end of a WPF expander control
body: <p>Hi I am attempting to put a green tick icon at the right end of a WPF Expander control when a checkbox is set. My code currently is:</p>
  
  <pre><code>&lt;Expander x:Name="ImageExpander"&gt;
      &lt;Expander.Header&gt;
          &lt;Grid Width="450"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="*" /&gt;
                  &lt;ColumnDefinition Width="Auto" /&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;Label Padding="0"&gt;My Header Text&lt;/Label&gt;
              &lt;Image Grid.Column="1" Margin="0"
                     Source="C:\...\GreenTick.png" Width="18" /&gt;
          &lt;/Grid&gt;
      &lt;/Expander.Header&gt;
  &lt;/Expander&gt;
  </code></pre>
  
  <p>I used a grid to put the icon in the top right corner of the expander. This puts the header text in the usual spot next to the twiddle for expanding the expander. It also puts an icon 450 pixels further along near to the right end of the expander. </p>
  
  <p>I was hoping to have it not hard coded so that no matter how wide the expander grows the icon stays in the right corner. Can anybody advise how to do this? </p>
  
  <p>I tried binding the width of the expander.header to the width of the expander with no luck.</p>
  
  <p>Thanks for any advice!</p>