WPF How to disable DropShadowEffect

What is the best way to disable DropShadowEffect, for example, if you know that you are working on a remote session?

I might think about setting a transparent color, blur radius to 0, or opacity to zero, but I'm not sure if there is a difference in these options or if there is a better solution.

+7
source share
2 answers

Style triggers + Rendering levels is what you need. There are a few more friendly ways to bring back the level of rendering capabilities, but there is a general idea. If you are using terminal services or you are unable to render for hardware effects, you can remove the effect using a style trigger.

<Style> <Style.Triggers> <Trigger Property="Perf:RenderCapabilityWrapper.Tier" Value="0"> <Setter Property="Effect" Value="{x:Null}"/> </Trigger> <Trigger Property="Perf:RenderCapabilityWrapper.Tier" Value="1"> <Setter Property="Effect" Value="{StaticResource performanceShadow}"/> </Trigger> <Trigger Property="Perf:RenderCapabilityWrapper.Tier" Value="2"> <Setter Property="Effect" Value="{StaticResource qualityShadow}"/> </Trigger> </Style.Triggers> </Style> 
+10
source

Instead of disabling DropShadowEffect, you can customize the control to not even use the effect in the first place.

+1
source

All Articles