@@ -17,7 +17,6 @@ public class AttachedCardShadow : AttachedShadowBase
1717 private const float MaxBlurRadius = 72 ;
1818 private static readonly TypedResourceKey < CompositionGeometricClip > ClipResourceKey = "Clip" ;
1919 private static readonly bool SupportsCompositionVisualSurface ;
20- private static readonly bool SupportsCompositionGeometricClip ;
2120
2221 private static readonly TypedResourceKey < CompositionPathGeometry > PathGeometryResourceKey = "PathGeometry" ;
2322 private static readonly TypedResourceKey < CompositionRoundedRectangleGeometry > RoundedRectangleGeometryResourceKey = "RoundedGeometry" ;
@@ -34,12 +33,11 @@ public class AttachedCardShadow : AttachedShadowBase
3433 nameof ( CornerRadius ) ,
3534 typeof ( double ) ,
3635 typeof ( AttachedCardShadow ) ,
37- new PropertyMetadata ( 8d , OnDependencyPropertyChanged ) ) ;
36+ new PropertyMetadata ( 4d , OnDependencyPropertyChanged ) ) ; // Default WinUI ControlCornerRadius is 4
3837
3938 static AttachedCardShadow ( )
4039 {
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
4341 }
4442
4543 /// <summary>
@@ -51,15 +49,20 @@ public double CornerRadius
5149 set => SetValue ( CornerRadiusProperty , value ) ;
5250 }
5351
52+ /// <inheritdoc/>
5453 public override bool IsSupported => SupportsCompositionVisualSurface ;
54+
55+ /// <inheritdoc/>
5556 protected override bool SupportsOnSizeChangedEvent => true ;
5657
58+ /// <inheritdoc/>
5759 protected override void OnElementContextUninitialized ( AttachedShadowElementContext context )
5860 {
5961 context . ClearAndDisposeResources ( ) ;
6062 base . OnElementContextUninitialized ( context ) ;
6163 }
6264
65+ /// <inheritdoc/>
6366 protected override void OnPropertyChanged ( AttachedShadowElementContext context , DependencyProperty property , object oldValue , object newValue )
6467 {
6568 if ( property == CornerRadiusProperty )
@@ -78,6 +81,7 @@ protected override void OnPropertyChanged(AttachedShadowElementContext context,
7881 }
7982 }
8083
84+ /// <inheritdoc/>
8185 protected override CompositionBrush GetShadowMask ( AttachedShadowElementContext context )
8286 {
8387 if ( ! SupportsCompositionVisualSurface )
@@ -115,6 +119,7 @@ protected override CompositionBrush GetShadowMask(AttachedShadowElementContext c
115119 return surfaceBrush ;
116120 }
117121
122+ /// <inheritdoc/>
118123 protected override CompositionClip GetShadowClip ( AttachedShadowElementContext context )
119124 {
120125 var pathGeom = context . GetResource ( PathGeometryResourceKey ) ??
@@ -141,6 +146,7 @@ protected override CompositionClip GetShadowClip(AttachedShadowElementContext co
141146 return clip ;
142147 }
143148
149+ /// <inheritdoc/>
144150 protected override void OnSizeChanged ( AttachedShadowElementContext context , Size newSize , Size previousSize )
145151 {
146152 var sizeAsVec2 = newSize . ToVector2 ( ) ;
0 commit comments