Silverlight玻璃边框样式的按钮

<Style x:Key="GlassBorderStyle" TargetType="Border"> <Setter Property="BorderThickness" Value="2"/> <Setter Property="Padding" Value="5"/> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush EndPoint="0.75,1" StartPoint="0.25,0"> <GradientStop Color="#33FFFFFF" Offset="0"/> <GradientStop Color="#C0FFFFFF" Offset="0.287"/> <GradientStop Color="#4011322D" Offset="0.683"/> <GradientStop Color="#33FFFFFF" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property="BorderBrush"> <Setter.Value> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#5811322D" Offset="0"/> <GradientStop Color="#3EFFFFFF" Offset="0.25"/> <GradientStop Color="#FFFFFFFF" Offset="0.5"/> <GradientStop Color="#3EFFFFFF" Offset="0.75"/> <GradientStop Color="#BFFFFFFF" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property="Effect"> <Setter.Value> <DropShadowEffect BlurRadius="3" ShadowDepth="3" Opacity="0.5"/> </Setter.Value> </Setter> </Style>  

 

使用上面的样式:

<Border x:Name="GlassBorder" Height="100" Width="100" CornerRadius="10" Style="{StaticResource GlassBorderStyle}" mce_Style="{StaticResource GlassBorderStyle}"> <Button Content="OK"/> </Border>

 

演示地址:http://silverlike.net/silverlight/index.php?xap=%2Fwp-content%2Fuploads%2Fxap%2FGlassBorderStyle.xap&TB_iframe=true&caption=Glass+Border+Style+Button&height=400&width=650

 

转自:http://www.silverlightchina.net/html/works/2009/1127/266.html

你可能感兴趣的:(iframe,silverlight,border,button,setter)