-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Shadow Receiver XAML Helpers #3122
Comments
Hello michael-hawker, thank you for opening an issue with us! I have automatically added a "needs triage" label to help get things started. Our team will investigate the issue and help solve it ASAP. Other community members may also look into the issue and provide feedback 🙌 |
Thanks for submitting a new feature request! I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future! |
Yes please! The ThemeShadow is super powerful and creates super nice effects, but it's hard to use. This would really simplify stuff and useable for DataTemplates as well! |
@niels9001 we just got this to work on my dev stream! 🎉🎉🎉 Have a proof of concept that I'll need to create a PR for the toolkit for and test in other scenarios, but basically we have this syntax now for setting up Shadows, it's super nice 🦙❤: <Grid x:Name="LayoutRoot">
<Grid.Resources>
<ThemeShadow x:Key="BackgroundGridShadow">
<ex:ShadowExtensions.CastTo>
<ex:Surface Target="{x:Bind BackgroundGrid}"/>
</ex:ShadowExtensions.CastTo>
</ThemeShadow>
<ThemeShadow x:Key="PoolShadow">
<ex:ShadowExtensions.CastTo>
<ex:Surface Target="{x:Bind BackgroundGrid}"/>
<ex:Surface Target="{x:Bind BedroomGrid}"/>
<ex:Surface Target="{x:Bind LoungeGrid}"/>
</ex:ShadowExtensions.CastTo>
</ThemeShadow>
</Grid.Resources>
<Grid x:Name="BackgroundGrid"/>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid x:Name="BedroomGrid" Background="White" Grid.Column="0" Width="255" Height="124" Shadow="{StaticResource BackgroundGridShadow}" Translation="0,0,8">
<Image Source="ms-appx:///Assets/BedRoom.jfif" Stretch="UniformToFill"/>
</Grid>
<Grid x:Name="LoungeGrid" Background="White" Grid.Column="2" Width="255" Height="124" Margin="-48,0,0,0" Shadow="{StaticResource BackgroundGridShadow}"
Translation="0,0,32">
<Image Source="ms-appx:///Assets/Lounge.jfif" Stretch="UniformToFill"/>
</Grid>
<Grid x:Name="PoolGrid" Background="White"
Grid.Column="1" Width="320" Height="156"
Shadow="{StaticResource PoolShadow}"
Translation="0,0,64">
<Image Source="ms-appx:///Assets/Pool.jfif" Stretch="UniformToFill"/>
</Grid>
</Grid>
</Grid> Still have to test with transitions and data templates and such, but seems like a promising start. Let me know if this syntax seems good to you too! |
Great stuff :)! This is super helpful!!! |
6.1 is already pretty heavy, and I have a few other bits to focus on with higher priority. However, I think the secondary theme of our 7.0 release can be Animations and Composition helpers, including this one and maybe some others. :) |
@michael-hawker Just wanted to check, is this feature still on the roadmap for 7.0? That should drop in August/September if I recall correctly? |
@niels9001 this is indeed something we have on the 7.0 roadmap as high-priority, though we haven't set a specific release date yet. I think I said I'd be figuring out the date by Aug/Sept. 😋 Main reason is we haven't dug into evaluating the scope of work on the tech-debt called out in our release plan, that'll start happening at the end of August. I have my prototype code that I did on stream for this a while back which I should upload somewhere. After UnoConf, I'll have be shifting focus back to clean-up and these shadow features. I'd like to try and improve DropShadowPanel as well to work more like the ThemeShadow helper I made, if its possible too. |
From F8R on Discord:
|
Any news on this? |
Because ThemeShadow is limited, we're still planning to investigate if we can create a similar solution for DropShadows for 7.1. Something that's easier to add on top of existing XAML than having to insert special panels like We do want to ensure it handles more scenarios like the request from #3607 as well. |
See the PR with the new shadow system we have for Drop Shadows here: #4179 Super simple to use with Win2D, and not much harder to use with just composition! |
## Fixes #3122 #3607 #3516 _Also implements #3693 for the new DropShadow._ FYI @seanocali as this is a different implementation approach (which is simpler to use outside of the DropShadowPanel we've been working on) but should hopefully achieve the same result. This PR adds attached shadows which can easily be attached to any FrameworkElement without needing to modify the layout like DropShadowPanel does today. They can also be shared using a resource, added to the style of an element, and animated! All the things! 🎉 ## PR Type What kind of change does this PR introduce? <!-- Please uncomment one or more options below that apply to this PR. --> <!-- - Bugfix --> - Feature by @Ryken100 and integrated/extended by @michael-hawker <!-- - Code style update (formatting) --> <!-- - Refactoring (no functional changes, no api changes) --> <!-- - Build or CI related changes --> <!-- - Documentation content changes --> <!-- - Sample app changes --> <!-- - Other... Please describe: --> ## What is the current behavior? DropShadowPanel is clunky and requires modifying how you layout your app. ## What is the new behavior? Just attach a shadow and be done! (DropShadowPanel is deprecated.) ## PR Checklist - [x] Composition Only Shadow Support? (with Target) - [x] Add XML Docs - [x] Animation Support to Explicit Animation System? - [x] Bug can't use `AttachedCardShadow` directly with `Border`? Please check if your PR fulfills the following requirements: <!-- and remove the ones that are not applicable to the current PR --> - [ ] Tested code with current [supported SDKs](../#supported) - [ ] Pull Request has been submitted to the documentation repository [instructions](../blob/main/Contributing.md#docs). Link: <!-- docs PR link --> - [ ] Sample in sample app has been added / updated (for bug fixes / features) - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/CommunityToolkit/WindowsCommunityToolkit-design-assets) - [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/CommunityToolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc... - [ ] Tests for the changes have been added (for bug fixes / features) (if applicable) - [ ] Header has been added to all new source files (run _build/UpdateHeaders.bat_) - [ ] Contains **NO** breaking changes <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. --> ## Other information <!-- Please add any other information that might be helpful to reviewers. -->
Describe the problem this feature would solve
To use the new Shadow API in XAML without code-behind. See blog here for more examples.
Describe the solution
A way to make it easier to use shadows in apps via XAML. Initial Proposal example:
The text was updated successfully, but these errors were encountered: