Skip to content

Conversation

@arcadiogarcia
Copy link
Member

Fixes

#3693

PR Type

What kind of change does this PR introduce?

Feature

What is the current behavior?

DropShadowPanel does not allow user controls to specify a custom alpha mask

What is the new behavior?

User controls can choose to implement IAlphaMaskProvider and their alpha mask will be picked up by the DropShadowPanel

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the 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

Other information

@ghost
Copy link

ghost commented Jul 13, 2021

Thanks arcadiogarcia for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@michael-hawker
Copy link
Member

michael-hawker commented Jul 13, 2021

Thanks @arcadiogarcia! We're working on some new Drop Shadow stuff too (outside DropShadowPanel), hopefully will have a PR for that open soon. So we should coordinate and see if this neat interface trick can work there too. Should know more by next week I think?

I'll convert this to a draft for now until we sync on coordination.

@michael-hawker michael-hawker marked this pull request as draft July 13, 2021 23:50
/// <summary>
/// Any user control can implement this interface to provide a custom alpha mask to it's parent <see cref="DropShadowPanel"/>
/// </summary>
public interface IAlphaMaskProvider
Copy link
Member

@michael-hawker michael-hawker Jul 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to the Microsoft.Toolkit.Uwp.UI library? (Helpers folder I think would be fine.)

If no namespace is provided where does it end up, the root of the assembly's one? (It should just live in the root UI namespace.)

@michael-hawker michael-hawker marked this pull request as ready for review July 15, 2021 18:05
using Windows.UI.Composition;

/// <summary>
/// Any user control can implement this interface to provide a custom alpha mask to it's parent <see cref="DropShadowPanel"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think there's no namespace the comment can't be resolved properly?

D:\a\1\s\Microsoft.Toolkit.Uwp.UI.Controls.Core\DropShadowPanel\IAlphaMaskProvider.cs(8,108): error CS1574: XML comment has cref attribute 'DropShadowPanel' that could not be resolved [D:\a\1\s\Microsoft.Toolkit.Uwp.UI.Controls.Core\Microsoft.Toolkit.Uwp.UI.Controls.Core.csproj]

Once moved though we won't be able to reference the control directly anyway, just in text.

@michael-hawker michael-hawker added this to the 7.1 milestone Jul 15, 2021
@michael-hawker michael-hawker added the next preview ✈️ Label for marking what we want to include in the next preview release for developers to try. label Jul 15, 2021
@michael-hawker
Copy link
Member

@arcadiogarcia mind making the quick file move and addressing the comments and we can get this in? Thanks!


using Windows.UI.Composition;

namespace Microsoft.Toolkit.Uwp.UI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The physical file needs to move within the Microsoft.Toolkit.Uwp.UI assembly as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, I'll move it there! Any suggestion on where to place it? None of the existing folders seems relevant, is it ok if I create one called DropShadowPanel (following the same pattern as AdvancedCollectionView)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just putting in the Helpers folder for now would be alright. It'll be in the root namespace still, so folder structure doesn't really matter, we can always move it later if we want without breaking anyone. Thanks!

@ghost
Copy link

ghost commented Jul 22, 2021

This PR has been marked as "needs attention 👋" and awaiting a response from the team.

@michael-hawker michael-hawker merged commit d863f11 into CommunityToolkit:main Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls 🎛️ improvements ✨ needs attention 👋 next preview ✈️ Label for marking what we want to include in the next preview release for developers to try. priority 🚩

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants