Hi,
I have a user control that contains an ellipse. The ellipse is translate transformed to the right until it lies partially outside its parent control.
I put the user control into the middle column of a 3 column grid.
If I set the column width to GridUnitType.Auto I can see the ellipse overflowing the column. If I set the column width to GridUnitType.Star the ellipse still overflows the column, but it is now clipped to the column width.
I need to evenly distributed the column widths using GridUnitType.Star, but do not want any transformed content to be clipped.
I've included the sample code below. Any help would be appreciated.
UserControl (containing ellipse)
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="GridWidthTest.UserControl1">
<Grid x:Name="LayoutRoot" Background="Green">
<Ellipse Fill="#FFF40404" Stroke="Black" Grid.Column="1" Width="400" Height="400" RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform X="200"/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
</Grid>
Parent control (containing the grid)
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GridWidthTest" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Class="GridWidthTest.MainPage"
Width="640" Height="480" mc:Ignorable="d">
<Grid x:Name="LayoutRoot" Background="White">
<Grid ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<local:UserControl1 Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
</Grid>
</Grid>