타원이 포함 된 사용자 정의 컨트롤이 있습니다. 타원은 부분적으로 상위 컨트롤 외부에있을 때까지 오른쪽으로 변환됩니다.부모 열 너비가 GridUnitType.Star로 설정된 경우 Silverlight 클리핑 UserControl
사용자 정의 컨트롤을 3 열 그리드의 중간 열에 넣습니다.
열 너비를 GridUnitType.Auto로 설정하면 타원이 넘치는 것을 볼 수 있습니다. 열 너비를 GridUnitType.Star로 설정하면 타원은 여전히 열을 오버플로하지만 열 너비에 맞게 잘립니다.
GridUnitType.Star를 사용하여 열 너비를 고르게 분산해야하지만 변환 된 내용이 잘리지 않도록하십시오.
아래 샘플 코드를 포함 시켰습니다. 어떤 도움을 주시면 감사하겠습니다.
의 UserControl (타원 함유) (격자 함유)
<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>
부모 제어
<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>
독창적 인! 이것은 잘 작동합니다. – McGarnagle