我正在开发Windows Phone 8应用,并且我具有以下带有Border
的StackPanel
,但StackPanel
未被裁剪到Border
<Border Grid.Column="1" BorderThickness="3" BorderBrush="Black" CornerRadius="50">
<StackPanel Width="425">
<StackPanel.Background>
<SolidColorBrush Color="#FFFBEAEA" Opacity="0.25"/>
</StackPanel.Background>
<TextBlock Text="{Binding Name}" Style="{StaticResource PhoneTextLargeStyle}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" TextWrapping="Wrap" Margin="12,0,12,6" Foreground="Black"/>
<TextBlock Text="{Binding Type}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Foreground="Black"/>
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiLight}" Foreground="Black"/>
</StackPanel>
</Border>
我不知道为什么我在网上做了一些挖掘工作,但是sample无效。
有人可以帮助我吗?谢谢。
您能否通过将背景设置为border而不是stackpanel来尝试。几乎所有内容都相同。
不幸的是,没有剪切内容,它就如您所见。
而不是使用ClipToBounds
或OpacityMask
,请尝试使用径向渐变作为附加Border
元素的背景。
我从this article得到了一个很好的答案。