@@ -17,7 +17,6 @@ public class AttachedCardShadow : AttachedShadowBase
17
17
private const float MaxBlurRadius = 72 ;
18
18
private static readonly TypedResourceKey < CompositionGeometricClip > ClipResourceKey = "Clip" ;
19
19
private static readonly bool SupportsCompositionVisualSurface ;
20
- private static readonly bool SupportsCompositionGeometricClip ;
21
20
22
21
private static readonly TypedResourceKey < CompositionPathGeometry > PathGeometryResourceKey = "PathGeometry" ;
23
22
private static readonly TypedResourceKey < CompositionRoundedRectangleGeometry > RoundedRectangleGeometryResourceKey = "RoundedGeometry" ;
@@ -34,12 +33,11 @@ public class AttachedCardShadow : AttachedShadowBase
34
33
nameof ( CornerRadius ) ,
35
34
typeof ( double ) ,
36
35
typeof ( AttachedCardShadow ) ,
37
- new PropertyMetadata ( 8d , OnDependencyPropertyChanged ) ) ;
36
+ new PropertyMetadata ( 4d , OnDependencyPropertyChanged ) ) ; // Default WinUI ControlCornerRadius is 4
38
37
39
38
static AttachedCardShadow ( )
40
39
{
41
- SupportsCompositionGeometricClip = ApiInformation . IsTypePresent ( typeof ( CompositionGeometricClip ) . FullName ) ;
42
- SupportsCompositionVisualSurface = ApiInformation . IsTypePresent ( typeof ( CompositionVisualSurface ) . FullName ) ; ;
40
+ SupportsCompositionVisualSurface = ApiInformation . IsTypePresent ( typeof ( CompositionVisualSurface ) . FullName ) ; // Note: This is 1903 (18362) min
43
41
}
44
42
45
43
/// <summary>
@@ -51,15 +49,20 @@ public double CornerRadius
51
49
set => SetValue ( CornerRadiusProperty , value ) ;
52
50
}
53
51
52
+ /// <inheritdoc/>
54
53
public override bool IsSupported => SupportsCompositionVisualSurface ;
54
+
55
+ /// <inheritdoc/>
55
56
protected override bool SupportsOnSizeChangedEvent => true ;
56
57
58
+ /// <inheritdoc/>
57
59
protected override void OnElementContextUninitialized ( AttachedShadowElementContext context )
58
60
{
59
61
context . ClearAndDisposeResources ( ) ;
60
62
base . OnElementContextUninitialized ( context ) ;
61
63
}
62
64
65
+ /// <inheritdoc/>
63
66
protected override void OnPropertyChanged ( AttachedShadowElementContext context , DependencyProperty property , object oldValue , object newValue )
64
67
{
65
68
if ( property == CornerRadiusProperty )
@@ -78,6 +81,7 @@ protected override void OnPropertyChanged(AttachedShadowElementContext context,
78
81
}
79
82
}
80
83
84
+ /// <inheritdoc/>
81
85
protected override CompositionBrush GetShadowMask ( AttachedShadowElementContext context )
82
86
{
83
87
if ( ! SupportsCompositionVisualSurface )
@@ -115,6 +119,7 @@ protected override CompositionBrush GetShadowMask(AttachedShadowElementContext c
115
119
return surfaceBrush ;
116
120
}
117
121
122
+ /// <inheritdoc/>
118
123
protected override CompositionClip GetShadowClip ( AttachedShadowElementContext context )
119
124
{
120
125
var pathGeom = context . GetResource ( PathGeometryResourceKey ) ??
@@ -141,6 +146,7 @@ protected override CompositionClip GetShadowClip(AttachedShadowElementContext co
141
146
return clip ;
142
147
}
143
148
149
+ /// <inheritdoc/>
144
150
protected override void OnSizeChanged ( AttachedShadowElementContext context , Size newSize , Size previousSize )
145
151
{
146
152
var sizeAsVec2 = newSize . ToVector2 ( ) ;
0 commit comments