void SetMainContent(Views.IWindowView view)
        {
            if (view == null)
            {
                return;
            }

            var content = view.GetMainContent();

            if (content != null)
            {
                panel1.Child = content;
                if (_currentView != null)
                {
                    if (_currentView is IDisposable)
                    {
                        ((IDisposable)(_currentView)).Dispose();
                    }
                }
                _currentView = view;
            }
        }
Ejemplo n.º 2
0
        void SetMainContent(Views.IWindowView view)
        {
            if (view == null)
            {
                return;
            }

            var content = view.GetMainContent();

            if (content != null)
            {
                panel1.Controls.Add(content);

                if (_currentView != null)
                {
                    if (_currentView is IDisposable)
                    {
                        ((IDisposable)(_currentView)).Dispose();
                    }
                    panel1.Controls.RemoveAt(0);
                }
                _currentView = view;
            }
        }