共用方式為


HOW TO:建立柔邊視覺效果動畫

更新:2007 年 11 月

下列範例顯示如何將 BlurBitmapEffectRadius 屬性顯示為動畫,讓 Button 在按下之後會顯得模糊。

範例

<Page xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml" >

  <StackPanel>

    <Button  Width="200">
      Click to Blur ME!
      <Button.BitmapEffect>

        <!-- This BitmapEffect is targeted by the animation. -->
        <BlurBitmapEffect x:Name="myBlurBitmapEffect"  Radius="0" />

      </Button.BitmapEffect>
      <Button.Triggers>
        <EventTrigger RoutedEvent="Button.Click">
          <BeginStoryboard>
            <Storyboard>

              <!-- Blur the Button and then animate back to normal. -->
              <DoubleAnimation
               Storyboard.TargetName="myBlurBitmapEffect"
               Storyboard.TargetProperty="Radius"
               From="0" To="40" Duration="0:0:0.3"
               AutoReverse="True" />
            </Storyboard>
          </BeginStoryboard>
        </EventTrigger>
      </Button.Triggers>
    </Button>

  </StackPanel>

</Page>

請參閱

工作

HOW TO:對 Visual 物件套用模糊效果

HOW TO:建立光暈效果動畫

HOW TO:建立下拉式陰影視覺效果的動畫

HOW TO:建立多個視覺效果的動畫