Esempio n. 1
0
        private void DocumentGroupItemAdd(DocumentPanelCaptionModel caption, Control content)
        {
            content.Margin = new Thickness(5);

            var items = DocumentGroupMain.Items;
            var singleOrDefaultPanel = items.SingleOrDefault(a => ((DocumentPanelCaptionModel)a.Caption).LeftMenuId == caption.LeftMenuId);

            if (singleOrDefaultPanel == null)
            {
                var documentPanel = new DocumentPanel
                {
                    Caption = caption,
                    CustomizationCaption = caption.ToString(),
                    AllowFloat           = false,
                    AllowHide            = false,
                    Content  = content,
                    IsActive = true
                };
                items.Add(documentPanel);
            }
            else
            {
                singleOrDefaultPanel.IsActive = true;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 处理 Control 控件的显示方式
        /// </summary>
        /// <param name="caption"></param>
        /// <param name="dllPath"></param>
        /// <param name="entryFunction"></param>
        /// <param name="menuId"></param>
        private void ControlShowOrAddToDocumentGroup(DocumentPanelCaptionModel caption, string dllPath, string entryFunction, string menuId)
        {
            var content = GetControl(dllPath, entryFunction, menuId);

            if (content == null)
            {
                return;
            }
            if ((content as Window) != null)
            {
                ((Window)content).ShowDialog();
            }
            else
            {
                DocumentGroupItemAdd(caption, content);
            }
        }