开发者

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"></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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜