Is it possible to automatically resize a grid column in XAML when its contents are scaled?
Below are two screenshots to better explain what I mean. When the UserControl is first displayed it looks like:
The intention is that the white rounded rectangle (with the textblock, combobox and slider) should always be positioned off to the right of the grey rectangle. However, when the grey rectangle is scaled up from the code behind, the grid column width does not increase to accomodate this and creates the overlap as seen below.
Is there some way to make this column change width automatically to fit the controls inside from XAML?
My XAML currently looks like:
<UserControl
x:Class="Project.Items.Bubble"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Project.Items">
<UserControl.Resources>
<ResourceDictionary
Source="./Assets/BubbleResourceDictionary.xaml" />
</UserControl.Resources>
<Grid
ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="Auto" />
<ColumnDefinition
Width="Auto" />
</Grid.ColumnDefinitions>
<Grid
x:Name="ObjectRoot"
Style="{StaticResource ObjectRootStyle}">
<Rectangle
Style="{StaticResource RectangleStyle}" />
<Rectangle
Style="{StaticResource HighlightStyle}" />
<TextBlock
Style="{StaticResource TextStyle}"
Text="<Text>" />
</Grid>
<local:Editor
x:Name="Editor"
VerticalAlignment="Top"
HorizontalAlignment="Right"
Grid.Column="1" />
</Grid>
Note: This is in Silverlight.