Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
        }