Пример #1
0
        /// ------------------------------------------------------------------------------------
        internal void SetActiveView(ITabView view, bool activateViewsForm)
        {
            if (view == null)
            {
                return;
            }

            foreach (var tab in Tabs.Where(t => t.View is ITabView))
            {
                var  tabsView = tab.View as ITabView;
                bool active   = (tabsView == view);
                tabsView.SetViewActive(active, tab.IsViewDocked);
                tabsView.TMAdapter.AllowUpdates = active;
            }

            App.CurrentView     = view;
            App.CurrentViewType = view.GetType();

            var ctrl = view as Control;

            if (activateViewsForm && ctrl != null && ctrl.FindForm() != null)
            {
                if (ctrl.FindForm().WindowState == FormWindowState.Minimized)
                {
                    ctrl.FindForm().WindowState = FormWindowState.Normal;
                }

                ctrl.FindForm().Activate();
            }

            App.MsgMediator.SendMessage("ActiveViewChanged", view);
        }