File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Microsoft.Toolkit.Uwp.UI.Media/Shadows Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -305,20 +305,17 @@ protected internal override void OnSizeChanged(AttachedShadowElementContext cont
305
305
{
306
306
Vector2 sizeAsVec2 = newSize . ToVector2 ( ) ;
307
307
308
- CompositionRoundedRectangleGeometry geometry = context . GetResource ( RoundedRectangleGeometryResourceKey ) ;
309
- if ( geometry != null )
308
+ if ( context . TryGetResource ( RoundedRectangleGeometryResourceKey , out CompositionRoundedRectangleGeometry geometry ) )
310
309
{
311
310
geometry . Size = sizeAsVec2 ;
312
311
}
313
312
314
- CompositionVisualSurface visualSurface = context . GetResource ( VisualSurfaceResourceKey ) ;
315
- if ( geometry != null )
313
+ if ( context . TryGetResource ( VisualSurfaceResourceKey , out CompositionVisualSurface visualSurface ) )
316
314
{
317
315
visualSurface . SourceSize = sizeAsVec2 ;
318
316
}
319
317
320
- ShapeVisual shapeVisual = context . GetResource ( ShapeVisualResourceKey ) ;
321
- if ( geometry != null )
318
+ if ( context . TryGetResource ( ShapeVisualResourceKey , out ShapeVisual shapeVisual ) )
322
319
{
323
320
shapeVisual . Size = sizeAsVec2 ;
324
321
}
You can’t perform that action at this time.
0 commit comments