Note that there are some explanatory texts on larger screens.

plurals
  1. POexpand parent size according to child size
    primarykey
    data
    text
    <p>I have an <code>Expander</code> that is inside a <code>TabItem</code>, inside a <code>TabControl</code> inside a WPF <code>Window</code>.</p> <p>I want to know how to make all the parents resize according to the expander size.</p> <p>This is my xaml, after editing some items that are not really important.</p> <pre><code>&lt;Window x:Name="Configurator" x:Class="Configurator.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Configuration Generator" Height="605.542" Width="566.584" Icon="radawre.png" ResizeMode="NoResize" SizeToContent="WidthAndHeight"&gt; &lt;Window.Resources&gt; &lt;AlternationConverter x:Key="AlternationConverter"/&gt; &lt;/Window.Resources&gt; &lt;Grid&gt; &lt;Button x:Name="generateButton" Content="Generate" HorizontalAlignment="Left" &lt;/Grid&gt; &lt;/TabItem&gt; &lt;TabItem x:Name="virtTab" Header="Virtualization" &gt; &lt;Grid Background="White"&gt; &lt;Expander x:Name="vadcDetailsExpander" Header="vADC Details" HorizontalAlignment="Left" Margin="452,10,-222,-18" VerticalAlignment="Top" ExpandDirection="Right" Height="404" Width="311" Collapsed="getDetailedVadc" UseLayoutRounding="False"&gt; &lt;StackPanel x:Name="vadcExpandedStackPanel" Width="229"&gt; &lt;Label x:Name="vadcCuLabel" Content="CU"/&gt; &lt;TextBox x:Name="vadcExpandedCu"/&gt; &lt;Label x:Name="vadcExpandedLimitLabel" Content="Throughput Limit"/&gt; &lt;TextBox x:Name="vadcExpandedLimit"/&gt; &lt;Label x:Name="vadcRealServersLabel" Content="Real Servers"/&gt; &lt;TextBox x:Name="vadcExpandedRealServer"/&gt; &lt;Label x:Name="vadcExpandedGroupsLabel" Content="Groups"/&gt; &lt;TextBox x:Name="vadcExpandedGroups"/&gt; &lt;WrapPanel Orientation="Horizontal"&gt; &lt;CheckBox x:Name="vadcExpendedL7" Content="L7 Enabled?" Margin="10,10,10,10" /&gt; &lt;CheckBox x:Name="vadcExpandedL3" Content="L3 Gateway?" Margin="10,10,10,10" /&gt; &lt;CheckBox x:Name="vadcExpandedVrrp" Content="VRRP?" Margin="10,10,10,10" /&gt; &lt;GroupBox Header="VRRP Details" x:Name="expandedVrrpDetails" Height="60"&gt; &lt;StackPanel&gt; &lt;RadioButton x:Name="vadcExpandedMain" Content ="Main" GroupName="expandedVrrpDetails" Margin="1,1,1,1"/&gt; &lt;RadioButton x:Name="vadcExpandedBackup" Content="Backup" GroupName="expandedVrrpDetails" Margin="1,1,1,1"/&gt; &lt;/StackPanel&gt; &lt;/GroupBox&gt; &lt;/WrapPanel&gt; &lt;Label x:Name="expandedVadcHealthChecksLabel" Content="Health Checks"/&gt; &lt;ComboBox x:Name="expandedVadcHealthChecks" SelectedIndex="0"&gt; &lt;ComboBoxItem Content="icmp" ContentStringFormat="icmp"/&gt; &lt;ComboBoxItem Content="tcp" ContentStringFormat="tcp"/&gt; &lt;ComboBoxItem Content="http" ContentStringFormat="http"/&gt; &lt;ComboBoxItem Content="tcphalfopen" ContentStringFormat="tcphalfopen"/&gt; &lt;ComboBoxItem Content="httprst" ContentStringFormat="httprst"/&gt; &lt;/ComboBox&gt; &lt;Label x:Name="expandedVadcServiceLabel" Content="Service"/&gt; &lt;ComboBox x:Name="expandedVadcService" SelectedIndex="0"&gt; &lt;ComboBoxItem Content="HTTP" ContentStringFormat="HTTP"/&gt; &lt;ComboBoxItem Content="FTP" ContentStringFormat="FTP"/&gt; &lt;ComboBoxItem Content="DNS" ContentStringFormat="DNS"/&gt; &lt;/ComboBox&gt; &lt;/StackPanel&gt; &lt;/Expander&gt; &lt;/Grid&gt; &lt;/TabItem&gt; &lt;/TabControl&gt; &lt;/Grid&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload