CommunityToolkit / WindowsCommunityToolkit

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.
https://docs.microsoft.com/windows/communitytoolkit/
Other
5.88k stars 1.38k forks source link

DropShadowPanel streched in a Viewbox #2311

Open ThiBro opened 6 years ago

ThiBro commented 6 years ago

Hi Guys,

If I put a DropShadowPanel inside of a Viewbox with Strech="Fill" the DropShadowPanel doesn't work like expected here.

Take a look on my Screenshots for this:

image

image

You can use the following SourceCode to check this:

<Viewbox Stretch="Fill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="100,100,100,100">
            <Grid>
                <extControls:DropShadowPanel ShadowOpacity="1"
                                  BlurRadius="10"
                                  Color="Black"
                                  x:Name="MyShadow">
                    <Rectangle x:Name="Rect" Fill="Red" Width="100" Height="100" />
                </extControls:DropShadowPanel>
            </Grid>
        </Viewbox>

Best Regards Thilo

kbrons commented 6 years ago

Hi Thilo, thanks for reporting the issue! @hermitdave is there a chance you can take a look at this?

ThiBro commented 6 years ago

Hi @kbrons @hermitdave

frist of all thanks for your help. I just wanted to ask if you're working on this issue :)

Best Regards Thilo

hermitdave commented 6 years ago

I'm out of town at present with little computer time. I'll look at our next week

Apologies

Hermit

ThiBro commented 6 years ago

Thank you for the information.

Thilo

hermitdave commented 6 years ago

Chaps, my VS / machine is busted.. despite Reset and VS installation I cannot build the toolkit solution. I sadly cannot have a look until I sort it out.

Apologies

nmetulev commented 6 years ago

@hermitdave, are you able to take a look at this now?

hermitdave commented 6 years ago

Let me try a full solution compile.. if it works then definitely

hermitdave commented 6 years ago

I can't reproduce the issue on the current codebase dropshadowpanel2 dropshadowpanel1

nmetulev commented 6 years ago

@hermitdave, try it in a blank app and make sure the rectangle is not square. Here is what it looks like for me with the latest codebase and the repro code provided:

image

hermitdave commented 6 years ago

I have a repro and I'm looking into it. I've also reached out to composition team.

hermitdave commented 6 years ago

Having talked to composition team they can repro the same and are looking at Viewbox Fill option. They suggested that others should work

However the only one that works correctly is Uniform.

UniformToFill generates dropshadow that hides fully behind the content it is supposed to shadown.

Another suggestion is using CustomMask option rather than GetAlphaMask. This needs to be looked at further.

hermitdave commented 6 years ago

I have also tried is setting size to the grid that contains the DropShadowPanel and that works slightly better. Fill option though is no better.

Kyaa-dost commented 4 years ago

@ThiBro @hermitdave any update on this? Was this resolved?

hermitdave commented 4 years ago

I suppose asking is easier than reading through the conversation

Kyaa-dost commented 4 years ago

I have read the conversation but not certain what was decided since the convo goes back to 2018. Whether there was any resolution or not other than the convo mentioned above?

ThiBro commented 4 years ago

@Kyaa-dost for me it was not fixed. I just accepted the bug :)

Kyaa-dost commented 4 years ago

@ThiBro Thank you so much for the update 🙂