Example #1
0
        public void Execute(IPanel panel)
        {
            if (panel == null)
            {
                throw new ArgumentNullException("panel");
            }

            if (panel.Parent is IPanelContainer)
            {
                var parentContainer = panel.Parent as IPanelContainer;
                var panelIndex      = parentContainer.Presenters.IndexOf(panel);
                parentContainer.Shutdown(panel, b => { });

                var tabContainer = new TabContainer
                {
                    Header = new PanelHeader
                    {
                        Text = "Tab Container"
                    },
                };
                tabContainer.Activate();

                tabContainer.Presenters.Add(panel);
                parentContainer.Presenters.Insert(panelIndex, tabContainer);
            }
        }
Example #2
0
        /// <summary>
        /// Get Disks Top Tab Sub Container.
        /// </summary>
        /// <returns>Disks Top Tab Sub Container.</returns>
        private static IPanelContainer GetDisksTopTabSubContainer()
        {
            IViewModel topDriveC = RootNode.Inst.GetNode(@"\{78888951-2516-4e63-AC97-90E9D54351D8}\C:\");

            topDriveC.Refresh();

            var topDriveCpanel = new PanelBase
            {
                PanelContent = (IPanelContent)topDriveC
            };

            IViewModel topDriveD = RootNode.Inst.GetNode(@"\{78888951-2516-4e63-AC97-90E9D54351D8}\D:\");

            topDriveD.Refresh();

            var topDriveDpanel = new PanelBase
            {
                PanelContent = (IPanelContent)topDriveD,
            };

            topDriveDpanel.Activate();

            var subTabContainer2 = new TabContainer
            {
                Header = new PanelHeader
                {
                    Text = "Disks Container"
                },
            };

            subTabContainer2.Activate();

            subTabContainer2.Presenters.Add(topDriveCpanel);
            subTabContainer2.Presenters.Add(topDriveDpanel);
            return(subTabContainer2);
        }