DropShadowEffect on Rectangle causes the whole interface broken
Posted: 20 Mar 2025, 12:18
Hello. I have a problem. I am using unigine with noiesisgui. I have several interface files.
The problem is when there is a DropShadowEffect in a style xaml file the whole interface shifts and scales like half of size from it.
The only one button spoils entire window. I tried to comment out this directive and it works fine.
I would like to keep the effect but fix it.
The problem is when there is a DropShadowEffect in a style xaml file the whole interface shifts and scales like half of size from it.
The only one button spoils entire window. I tried to comment out this directive and it works fine.
I would like to keep the effect but fix it.
Code: Select all
<Button Content="Login" Margin="1490,809,17,6" Style="{DynamicResource KeyGray}"
Command="..." />
<Style x:Key="KeyGray" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border SnapsToDevicePixels="true" CornerRadius="6">
<Grid>
<Rectangle x:Name="background" Fill="#B5B5B5" RadiusX="7" RadiusY="7" />
<Rectangle x:Name="backgroundBlur" RadiusX="7" RadiusY="7" Stroke="#5C5C5C"
StrokeThickness="5">
<Rectangle.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="10" Opacity="0.5"/>
</Rectangle.Effect>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>