Here is the code that cause me problem since few hours:
TabItem newTab = new TabItem();
newTab.Header = source.Name;
newTab.Content = source.GetGui();
newTab.HorizontalContentAlignment = HorizontalAlignment.Stretch;
newTab.VerticalContentAlignment = VerticalAlignment.Stretch;
this.inputSourceDisplay.Items.Add(newTab);
The output is the control (from GetGui()) is showing but in the center vertical and in the center horizontal but haven’t stretch at it suppose.
How can I solve that or how can I debug that?
What does your “GetGui()” method return? Is it a UserControl? By default, UserControls explicitly set their Width and Height properties:
With the Height and Width explicitly set, the UserControl won’t respond to attributes like HorizontalContentAlignment.