/// <summary> /// Hides and dispose the popup and the content inside /// </summary> public async void Dispose() { if (_isdisposing || HidePopupStoryboard == null) { return; } _isdisposing = true; Window.Current.SizeChanged -= Current_SizeChanged; await HidePopupStoryboard.BeginAsync(); HidePopupStoryboard.Stop(); HidePopupStoryboard.Children.Clear(); HidePopupStoryboard = null; ShowPopupStoryboard.Stop(); ShowPopupStoryboard.Children.Clear(); ShowPopupStoryboard = null; _contentgr.Children.Clear(); _contentgr = null; _popup.Children.Clear(); if (_uicontent is IDisposable disposable) { disposable.Dispose(); } BackgroundColorBrsh = null; LightDismissColor = null; ContentPresentationGrid = null; _translatetransform = null; _popup = null; _isdisposing = false; GC.Collect(); }
public async void Dispose() { if (_isdisposing || HidePopupStoryboard == null) { return; } _isdisposing = true; await HidePopupStoryboard.BeginAsync(); HidePopupStoryboard.Stop(); HidePopupStoryboard.Children.Clear(); HidePopupStoryboard = null; ShowPopupStoryboard.Stop(); ShowPopupStoryboard.Children.Clear(); ShowPopupStoryboard = null; _contentgr.Children.Clear(); _contentgr = null; _popup.Children.Clear(); _popup = null; _isdisposing = false; GC.Collect(); }