public void Dispose()
 {
     if (_activeContent != null)
     {
         _activeContent.OnExit(null);
     }
     AvatarCache?.Dispose();
     ExpressionInfo?.Dispose();
 }
        public void SetFrame(ExpressionUI instance)
        {
            Messages.Clear();
            if (instance != _activeContent)
            {
                _history.Push(instance);
                _breadcrumbs.PushItem(ObjectNames.NicifyVariableName(instance.Name), () => NavigateHistory(instance));
            }
            ContentFrame.Clear();

            instance.Layout.CloneTree(ContentFrame);

            ExpressionUI previousContent = _activeContent;

            _activeContent = instance;
            if (previousContent != null)
            {
                previousContent.OnExit(_activeContent);
            }

            SetExpressionInfoBoxActive(instance, ExpressionInfo);
            _activeContent.BindControls(ContentFrame);
            _activeContent.OnEnter(this, previousContent);
        }