Search code examples
wpfxamluielement

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


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.


Solution

  • 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>