Exemplo n.º 1
0
        private void Managed_OnLoadModuleCompleted(object sender, ViewModel.LoadModuleEventArgs e)
        {
            if (_mainMenu != null)
            {
                _mainMenu.Stop();
            }
            if (e.ModuleInstance != null)
            {
                FrameworkElement content = e.ModuleInstance as FrameworkElement;
                if (content != null)
                {
                    if (content.Parent == null)
                    {
                        WorkHost.Visibility    = Visibility.Visible;
                        WebPartHost.Visibility = Visibility.Collapsed;
                        WebPartHost.Stop();

                        WorkHost.Navigation(content, e.ModuleInfo.Description);
                        Common.AppContext.IsMenuOpen = _fromMenu;
                    }
                }
            }
            else
            {
                string message = string.Format("打开模块'{0}'失败,请联系管理员!", e.ModuleInfo.Description);
                AppContext.SystemMessage(message);
                AppContext.ShowSystemMessageText();
                MessageWindow.Show("提示", message, MessageIcon.Error, MessageWindowType.Default);
            }
        }
Exemplo n.º 2
0
        public void NavigationWorkPanel(string tag)
        {
            try
            {
                WorkHost.PanelContent  = null;
                WorkHost.Visibility    = Visibility.Visible;
                WebPartHost.Visibility = Visibility.Collapsed;
                WebPartHost.Stop();

                UserControl workitem = null;
                string      titel    = "";
                switch (tag)
                {
                case "NewsManager": workitem = new WebParts.Views.NewsManager(); titel = "新闻管理"; break;

                case "SystemLog": workitem = new SMT.SAAS.Platform.Xamls.SystemLogger(); titel = " 系统日志"; break;

                case "CustomMenusSet":
                {
                    titel = "菜单列表";
                    if (_mainMenu == null)
                    {
                        _mainMenu = new Xamls.MainPagePart.CustomMenusSet();
                        _mainMenu.MenuItemMouseDown += new EventHandler <MouseButtonEventArgs>(menu_MenuItemMouseDown);
                        _mainMenu.ShortCutClick     += new EventHandler <OnShortCutClickEventArgs>(menu_ShortCutClick);
                        _mainMenu.MenuItemMouseMove += new EventHandler <MouseEventArgs>(menu_MenuItemMouseMove);
                        workitem = _mainMenu;
                    }
                    else
                    {
                        workitem = _mainMenu;
                    }
                    break;
                }

                default: break;
                }

                WorkHost.Navigation(workitem, titel);
                Common.AppContext.IsMenuOpen = _fromMenu;
            }
            catch (Exception ex)
            {
                string strmsg = "点击菜单时发生错误,原因:" + ex.ToString();
                SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(strmsg);
            }
        }