tags:

views:

37

answers:

2

Hi WPF Lovers,

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. Saghar Ayyaz

A: 

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
BitmapEffects are obsolete as from WPF 3.5
Samuel Jack
Check the answer of Samuel. Its the alternative and not obsolete. But Thanks for ur help.
Saghar
+3  A: 

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>
Samuel Jack
Thanks Samuel. Its saved my time and lot of problems.
Saghar