File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Microsoft.Toolkit.Uwp.UI.Controls.Core/DropShadowPanel Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 22// The .NET Foundation licenses this file to you under the MIT license.
33// See the LICENSE file in the project root for more information.
44
5+ using Microsoft . Toolkit . Uwp . UI . Controls . Core . DropShadowPanel ;
56using System ;
67using System . Numerics ;
7- using System . Threading . Tasks ;
88using Windows . UI ;
99using Windows . UI . Composition ;
1010using Windows . UI . Xaml ;
@@ -168,7 +168,11 @@ private void UpdateShadowMask()
168168 {
169169 CompositionBrush mask = null ;
170170
171- if ( Content is Image )
171+ if ( Content is IAlphaMaskProvider maskedControl )
172+ {
173+ mask = maskedControl . GetAlphaMask ( ) ;
174+ }
175+ else if ( Content is Image )
172176 {
173177 mask = ( ( Image ) Content ) . GetAlphaMask ( ) ;
174178 }
Original file line number Diff line number Diff line change 1+ using Windows . UI . Composition ;
2+
3+ namespace Microsoft . Toolkit . Uwp . UI . Controls . Core . DropShadowPanel
4+ {
5+ /// <summary>
6+ /// Any user control can implement this interface to provide a custom alpha mask to it's parent <see cref="DropShadowPanel"/>
7+ /// </summary>
8+ public interface IAlphaMaskProvider
9+ {
10+ /// <summary>
11+ /// This method should return the appropiate alpha mask to be used in the shadow of this control
12+ /// </summary>
13+ /// <returns>The alpha mask as a composition brush</returns>
14+ CompositionBrush GetAlphaMask ( ) ;
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments