Categories > Coding > C# >

DropShadow applies to Child Elements

Bones

deez nuts

Posts: 353

Threads: 10

Joined: Mar, 2021

Reputation: 11

Posted

Mods forgive me for posting XAML related stuff in C#, i don't have an other choice.

I want to add an shadow around the Window. I tried this piece of code 

        <Grid.Effect>
            <DropShadowEffect BlurRadius="15" Direction="-90"
                              RenderingBias="Quality" ShadowDepth="2"/>
        </Grid.Effect>

Instead of it applying to an Shadow around my Window, it applies to the Child Elements of the Grid. What am i doing wrong?

  • 0

Who's Deez?

Posts: 0

Threads: 0

Joined: ?

Reputation:

Replied

use a border or something for the window instead of grid, then do border.effect and apply the drop shadow effect.

example make the grid tag just <grid><border background="#121212"></grid> that should work C:

  • 0

Bones

deez nuts

Posts: 353

Threads: 10

Joined: Mar, 2021

Reputation: 11

Replied

@55258 I tried that, this only gives me an 90 Degree Shadow, but i want it to go fully around the Window.

  • 0

Who's Deez?

Zera

Casual Femboy Agent

vip

Posts: 1556

Threads: 39

Joined: Mar, 2020

Reputation: 42

Replied

@OrbitRBX

 

he said he wanted a drop shadow around the window not around the grid items.

 

Anyway to fix this you will need to use a border instead of an actual microsoft windowstyle, do windowstyle="none", resizemode as noresize and then do allowstransparency as true and get started

  • 0

https://cdn.discordapp.com/attachments/995469995742068832/1073019970012848228/Untitled39_20220604185345.png

Bones

deez nuts

Posts: 353

Threads: 10

Joined: Mar, 2021

Reputation: 11

Replied

@Laxion Thank you

  • 0

Who's Deez?

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )