0

Is there any workaround to apply more then one Effect on one UIElement in WPF? e.g.

<Button Content="Blurred (Radius=2)">
    <Button.Effect>
        <BlurEffect Radius="2"></BlurEffect>
    </Button.Effect>
</Button>

Thanks in advance.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Saghar
  • 693
  • 2
  • 12
  • 24
  • Following code explain, what do i mean. Unfortunately WPF allows us to use just one Effect at a time. I am asking for workaround for this problem. I have one in mind but want to see what people are using. May be my one is not so good. – Saghar Jun 23 '10 at 14:25

2 Answers2

3

You can wrap the UIElement in, say, a Border, and apply the additional effect to the Border.

  <Border>
    <Border.Effect>
        <DropShadowEffect/>
     </Border.Effect>
     <Button Content="Blurred (Radius=2)">
       <Button.Effect>
         <BlurEffect Radius="2"></BlurEffect>
       </Button.Effect>
      </Button>
  </Border>
Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Samuel Jack
  • 32,712
  • 16
  • 118
  • 155
0

Perhaps you might be interested in the BitmapEffectGroup:

 <Button Content="Blurred (Radius=2)">
     <Button.Effect>
         <BitmapEffectGroup>
             <BlurEffect Radius="2"></BlurEffect>
         </BitmapEffectGroup>
     </Button.Effect>
 </Button>
Arcturus
  • 26,677
  • 10
  • 92
  • 107