Esempio n. 1
0
        protected void Unmount()
        {
            using (Atom.NoWatch)
            {
                _doRebind?.Deactivate();
                _doRender?.Deactivate();

                if (_currentState != null)
                {
                    try
                    {
                        using (Atom.NoWatch)
                        {
                            Deactivate();
                            OnAfterDeactivate();
                        }
                    }
                    catch (Exception ex)
                    {
                        Zone.Current.HandleUncaughtException(ex);
                    }

                    DidStateDetached(_currentState);
                }
            }

            foreach (var child in _children)
            {
                child.Unmount();
            }

            if (_nextState != null)
            {
                _nextState.Value = null;
            }

            _currentState = null;
        }