开发者

WPF - The same effect on many elements

开发者 https://www.devze.com 2023-01-25 15:42 出处:网络
I have 64 labels with text. How can I apply this effect to开发者_开发百科 all of them except one?

I have 64 labels with text. How can I apply this effect to开发者_开发百科 all of them except one?

<BlurEffect Radius="8.0" KernelType="Box"/>


Try this

<Style TargetType="Label">
    <Setter Property="Effect">
        <Setter.Value>
            <BlurEffect Radius="8.0" KernelType="Box"/>
        </Setter.Value>
    </Setter>
</Style>

Update

For the Label that should't have this effect you can use

<Label Style="{x:Null}" ...>

or any other style that you may use


Put a style in your window resources which sets the Blur effect

<Style TargetType="{x:Type Label}">
    <Setter Property="Effect">
        <Setter.Value>
             <BlurEffect Radius="8.0" KernelType="Box"/> 
        </Setter.Value>
     </Setter>
</Style>
0

精彩评论

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