protected override void CreateChildElements() { base.CreateChildElements(); this.captionText = new TextPrimitive(); this.captionText.Class = "TitleCaption"; this.captionText.TextAlignment = ContentAlignment.MiddleCenter; int num1 = (int)this.captionText.SetValue(RibbonBarCaptionLayoutPanel.CaptionTextProperty, (object)true); int num2 = (int)this.captionText.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.OneWay); this.ribbonTextAndContextGroupPanel = new RibbonBarCaptionLayoutPanel(); this.ribbonTextAndContextGroupPanel.Children.Add((RadElement)this.captionText); this.Children.Add((RadElement)this.ribbonTextAndContextGroupPanel); this.systemButtons = new StackLayoutElement(); this.systemButtons.Orientation = Orientation.Horizontal; this.systemButtons.StretchHorizontally = false; this.systemButtons.StretchVertically = true; this.systemButtons.FitInAvailableSize = true; this.systemButtons.Class = "SystemButtonsContainer"; this.Children.Add((RadElement)this.systemButtons); this.helpButton = new RadImageButtonElement(); this.helpButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.helpButton.ThemeRole = "RibbonHelpButton"; this.helpButton.Class = "HelpButton"; this.helpButton.Click += new EventHandler(this.OnHelpButtonClick); this.helpButton.ButtonFillElement.Class = "CaptionButtonFill"; this.helpButton.BorderElement.Class = "CaptionButtonBorder"; this.helpButton.StretchHorizontally = false; this.helpButton.Visibility = ElementVisibility.Collapsed; this.systemButtons.Children.Add((RadElement)this.helpButton); this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.minimizeButton.ThemeRole = "RibbonMinimizeButton"; this.minimizeButton.Class = "MinimizeButton"; this.minimizeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.ribbon_minimize; this.minimizeButton.Click += new EventHandler(this.OnMinimize); this.minimizeButton.ButtonFillElement.Class = "CaptionButtonFill"; this.minimizeButton.BorderElement.Class = "CaptionButtonBorder"; this.minimizeButton.StretchHorizontally = false; this.systemButtons.Children.Add((RadElement)this.minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.maximizeButton.ThemeRole = "RibbonMaximizeButton"; this.maximizeButton.Class = "MaximizeButton"; this.maximizeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.ribbon_maximize; this.maximizeButton.Click += new EventHandler(this.OnMaximizeRestore); this.maximizeButton.ButtonFillElement.Class = "CaptionButtonFill"; this.maximizeButton.BorderElement.Class = "CaptionButtonBorder"; this.maximizeButton.StretchHorizontally = false; this.systemButtons.Children.Add((RadElement)this.maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.closeButton.ThemeRole = "RibbonCloseButton"; this.closeButton.Class = "CloseButton"; this.closeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.ribbon_close; this.closeButton.Click += new EventHandler(this.OnClose); this.closeButton.ButtonFillElement.Class = "CaptionButtonFill"; this.closeButton.BorderElement.Class = "CaptionButtonBorder"; this.closeButton.StretchHorizontally = false; this.systemButtons.Children.Add((RadElement)this.closeButton); }
public RadRibbonBarCaption(RadRibbonBarElement ribbonBarElement) { this.radRibbonBarElement = ribbonBarElement; //create the group panel, which needs a reference to the ribbon bar element this.ribbonTextAndContextGroupPanel = new RibbonBarCaptionLayoutPanel(this.radRibbonBarElement); this.ribbonTextAndContextGroupPanel.Children.Add(this.captionText); this.Children.Add(ribbonTextAndContextGroupPanel); }