title: c# Expander content is not on the left
body: <p>I have the problem that the content of the expander does not start at the left, how can I solve this?
  As you can see on the picture, the contents of my expander are not shown to the far left. I have tried many settings, unfortunately I do not come to the solution. The expander itself also seems to have an edge opposite the stackpanel, which I also want to avoid.
  Above the expander you can see a grid, which contains a text block with content. This grid has the right mass within the higher-level stack panel.</p>
  <pre><code>Expander exp = new Expander
          {
              Header = &quot;TestExpander&quot;,
              Width = spStackPanel.Width,
              ExpandDirection = ExpandDirection.Down,
              IsExpanded = true,
              BorderBrush = Brushes.Yellow,
              BorderThickness = new Thickness(1),
              HorizontalAlignment = HorizontalAlignment.Left,
              HorizontalContentAlignment = HorizontalAlignment.Left,
              VerticalAlignment = VerticalAlignment.Top,
              VerticalContentAlignment = VerticalAlignment.Top,
          };
  
          TextBox tx = new TextBox
          {
              Text = &quot;testText&quot;
          };
  
          exp.Content = tx;
  
          spStackPanel.Children.Add(exp);
  </code></pre>
  <p><a href="https://i.stack.imgur.com/b9tlm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b9tlm.jpg" alt="enter image description here" /></a></p>