Esempio n. 1
0
        void Destroy()
        {
            if (ShellItem != null)
            {
                UnhookEvents(ShellItem);
            }

            ((IShellController)ShellContext?.Shell)?.RemoveAppearanceObserver(this);

            if (_bottomSheetDialog != null)
            {
                _bottomSheetDialog.DismissEvent -= OnMoreSheetDismissed;
                _bottomSheetDialog?.Dispose();
                _bottomSheetDialog = null;
            }

            _navigationArea?.Dispose();
            _appearanceTracker?.Dispose();
            _outerLayout?.Dispose();

            if (_bottomView != null)
            {
                _bottomView?.SetOnNavigationItemSelectedListener(null);
                _bottomView?.Background?.Dispose();
                _bottomView?.Dispose();
            }

            _bottomView        = null;
            _navigationArea    = null;
            _appearanceTracker = null;
            _outerLayout       = null;
        }
Esempio n. 2
0
        protected virtual void OnMoreItemSelected(ShellSection shellSection, BottomSheetDialog dialog)
        {
            ChangeSection(shellSection);

            dialog.Dismiss();
            dialog.Dispose();
        }
Esempio n. 3
0
        protected virtual void OnMoreItemSelected(ShellSection shellSection, BottomSheetDialog dialog)
        {
            ChangeSection(shellSection);

            dialog.Dismiss();                 //should trigger OnMoreSheetDismissed, which will clean up the dialog
            if (dialog != _bottomSheetDialog) //should never be true, but just in case, prevent a leak
            {
                dialog.Dispose();
            }
        }
Esempio n. 4
0
        protected virtual void OnMoreSheetDismissed(object sender, EventArgs e)
        {
            OnShellSectionChanged();

            if (_bottomSheetDialog != null)
            {
                _bottomSheetDialog.DismissEvent -= OnMoreSheetDismissed;
                _bottomSheetDialog.Dispose();
                _bottomSheetDialog = null;
            }
        }
Esempio n. 5
0
        void OnMoreItemSelected(int selectedIndex, BottomSheetDialog dialog)
        {
            if (selectedIndex >= 0 && _bottomNavigationView.SelectedItemId != selectedIndex && Element.Children.Count > selectedIndex)
            {
                Element.CurrentPage = Element.Children[selectedIndex];
            }

            dialog.Dismiss();
            dialog.DismissEvent -= OnMoreSheetDismissed;
            dialog.Dispose();
        }