コード例 #1
0
        public override ControlStyleBuilderInfoList GetThemeDesignedControls(System.Windows.Forms.Control previewSurface)
        {
            RadTabStrip tabStrip = new RadTabStrip();

            tabStrip.Bounds = new System.Drawing.Rectangle(30, 30, 300, 50);

            tabStrip.TabStripElement.Bounds = new System.Drawing.Rectangle(0, 0, 298, 50);

            tabStrip.TabStripElement.Items.Add(new TabItem("TabItem1"));
            tabStrip.TabStripElement.Items.Add(new TabItem("TabItem2"));
            tabStrip.TabStripElement.Items.Add(new TabItem("TabItem3"));

            RadTabStrip tabStripStructure = new RadTabStrip();

            tabStripStructure.TabStripElement.Items.Add(new TabItem("Tab Item Text"));

            ControlStyleBuilderInfo designed = new ControlStyleBuilderInfo(tabStrip, tabStripStructure.RootElement);

            designed.MainElementClassName = typeof(RadTabStripElement).FullName;
            ControlStyleBuilderInfoList res = new ControlStyleBuilderInfoList();

            res.Add(designed);

            return(res);
        }
コード例 #2
0
 public TabStripEditManager(RadTabStrip tabStrip, TabItem tab)
 {
     this.tabStrip = tabStrip;
     this.tab      = tab;
 }
コード例 #3
0
        protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
        {
            if (e.Property == VisibilityProperty)
            {
                OnVisibilityChanged(EventArgs.Empty);

                if (!this.IsInValidState(true))
                {
                    return;
                }

                if (this.ElementTree.Control as RadTabStrip != null)
                {
                    RadTabStrip tabStrip = this.ElementTree.Control as RadTabStrip;
                    if (tabStrip != null)
                    {
                        if (tabStrip.EnableTabControlMode && this.ContentPanel != null)
                        {
                            ElementVisibility newValue = (ElementVisibility)e.NewValue;
                            if (newValue == ElementVisibility.Visible)
                            {
                                this.ContentPanelHost.Visibility = ElementVisibility.Visible;
                            }
                            else
                            {
                                this.ContentPanelHost.Visibility = ElementVisibility.Hidden;
                            }
                        }
                    }
                }
            }
            else if (e.Property == IsMouseOverProperty)
            {
                this.ParentTabStrip.CallOnTabHovered(new TabEventArgs(this));
            }
            else if (e.Property == EnabledProperty)
            {
                this.ContentPanel.Enabled = (bool)e.NewValue;
            }
            else if (e.Property == TextProperty || e.Property == ImageProperty)
            {
                // PATCH
                if (this.layout != null)
                {
                    this.layout.PerformLayout();

                    if (this.ParentTabStrip != null)
                    {
                        if (this.ParentTabStrip.BoxLayout != null)
                        {
                            this.ParentTabStrip.BoxLayout.PerformLayout();
                        }
                    }
                }
            }
            else if (e.Property == RadTabStripElement.IsSelectedProperty)
            {
                this.UpdateMargins();
            }

            if (this.UseNewLayoutSystem)
            {
                RadTabStripElement tabStripElement = this.ParentTabStrip;
                if (tabStripElement != null)
                {
                    if (e.Property == RadElement.StretchHorizontallyProperty)
                    {
                        if (tabStripElement.TabsPosition == TabPositions.Top || tabStripElement.TabsPosition == TabPositions.Bottom)
                        {
                            bool stretchText = (bool)e.NewValue;
                            this.layout.StretchHorizontally = stretchText;
                            //TODO:
                            //this.TextPrimitive.StretchHorizontally = stretchText;
                        }
                    }
                    if (e.Property == RadElement.StretchVerticallyProperty)
                    {
                        if (tabStripElement.TabsPosition == TabPositions.Left || tabStripElement.TabsPosition == TabPositions.Right)
                        {
                            bool stretchText = (bool)e.NewValue;
                            this.layout.StretchHorizontally = stretchText;
                        }
                    }
                }
            }

            base.OnPropertyChanged(e);
        }