File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
components/Extensions/src/Shadows Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,8 @@ protected internal virtual void OnElementContextInitialized(AttachedShadowElemen
161161 /// <param name="context">The <see cref="AttachedShadowElementContext"/> that is being uninitialized.</param>
162162 protected internal virtual void OnElementContextUninitialized ( AttachedShadowElementContext context )
163163 {
164- context . ClearAndDisposeResources ( ) ;
165164 ElementCompositionPreview . SetElementChildVisual ( context . Element , null ! ) ;
165+ context . ClearAndDisposeResources ( ) ;
166166 }
167167
168168 /// <inheritdoc/>
Original file line number Diff line number Diff line change @@ -135,6 +135,12 @@ private void Uninitialize()
135135
136136 IsInitialized = false ;
137137
138+ if ( Element != null )
139+ {
140+ ElementCompositionPreview . SetElementChildVisual ( Element , null ! ) ;
141+ Element . SizeChanged -= OnElementSizeChanged ;
142+ }
143+
138144 Parent . OnElementContextUninitialized ( this ) ;
139145
140146 if ( SpriteVisual != null )
@@ -148,12 +154,6 @@ private void Uninitialize()
148154 Shadow . Dispose ( ) ;
149155 }
150156
151- if ( Element != null )
152- {
153- ElementCompositionPreview . SetElementChildVisual ( Element , null ! ) ;
154- Element . SizeChanged -= OnElementSizeChanged ;
155- }
156-
157157 SpriteVisual = null ;
158158 Shadow = null ;
159159 ElementVisual = null ;
You can’t perform that action at this time.
0 commit comments