开发者

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

开发者 https://www.devze.com 2023-01-04 06:48 出处:网络
Is there any workaround to apply more then one Effect on one UIElement in WPF? e.g. <Button Content=\"Blurred (Radius=2)\">

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"></B开发者_C百科lurEffect>
    </Button.Effect>
</Button>

Thanks in advance.


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>


Perhaps you might be interested in the BitmapEffectGroup:

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号