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 2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ using Microsoft . Toolkit . Uwp . UI . Controls . Core . DropShadowPanel ;
5
6
using System ;
6
7
using System . Numerics ;
7
- using System . Threading . Tasks ;
8
8
using Windows . UI ;
9
9
using Windows . UI . Composition ;
10
10
using Windows . UI . Xaml ;
@@ -168,7 +168,11 @@ private void UpdateShadowMask()
168
168
{
169
169
CompositionBrush mask = null ;
170
170
171
- if ( Content is Image )
171
+ if ( Content is IAlphaMaskProvider maskedControl )
172
+ {
173
+ mask = maskedControl . GetAlphaMask ( ) ;
174
+ }
175
+ else if ( Content is Image )
172
176
{
173
177
mask = ( ( Image ) Content ) . GetAlphaMask ( ) ;
174
178
}
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