public void Close() { try { Closed?.Invoke(this, EventArgs.Empty); if (contentGrid.Children.FirstOrDefault() is IDisposable disposable) { disposable.Dispose(); } Device.BeginInvokeOnMainThread(() => { if (Parent is Grid grid && grid.Children != null) { grid.Children.Remove(this); } }); AllOpened.Remove(this); } catch (Exception e) { Log.Error(exception: e); } }
public void Close() { Closed?.Invoke(this, EventArgs.Empty); var disposable = contentGrid.Children.FirstOrDefault() as IDisposable; if (disposable != null) { disposable.Dispose(); } ((Grid)Parent).Children.Remove(this); AllOpened.Remove(this); }