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);
            }
        }
Example #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);
        }
 public void Show(Grid parentElement, string category = null)
 {
     Category = category;
     Device.BeginInvokeOnMainThread(() =>
     {
         parentElement.Children.Add(this);
         if (parentElement is IDialogViewHost dvh)
         {
             Grid.SetColumn(this, dvh.Column);
             Grid.SetRow(this, dvh.Row);
             Grid.SetColumnSpan(this, dvh.ColumnSpan);
             Grid.SetRowSpan(this, dvh.RowSpan);
         }
     });
     AllOpened.Add(this);
 }
Example #4
0
 public void Show(Grid parentElement)
 {
     parentElement.Children.Add(this);
     AllOpened.Add(this);
 }