silverlight 3中的模糊效果很不错:
<StackPanel HorizontalAlignment="Left">
<Button x:Name="Button1"
Content="Click This"
Click="Button1_Click">
<Button.Effect>
<BlurEffect Radius="2"/>
</Button.Effect>
</Button>
</StackPanel>
但我如何在代码背后做到:
private void Button1_Click(object sender, RoutedEventArgs e)
{
Button1.Content = "was clicked";
//Button1.Effect.bl...
}
答案 0 :(得分:1)
仅限Silverlight 3
private void Button1_Click(object sender, RoutedEventArgs e)
{
((Button)sender).Content = "was clicked";
((Button)sender).Effect = new BlurEffect { Radius = 8 };
}