Beispiel #1
0
        private void CollapseChunkToDropDown()
        {
            this.ExpandElementToStep((int)ChunkVisibilityState.Expanded);

            ExpandableStackLayout.InvalidateAll(this);

            SizeF thisSize = this.DesiredSize;

            this.elementWithCaptionLayoutPanel.SuspendThemeRefresh();
            this.Children.Remove(this.elementWithCaptionLayoutPanel);
            this.elementWithCaptionLayoutPanel.ResumeThemeRefresh();

            RadItem item = new RadItem();

            item.UseNewLayoutSystem = true;
            item.AutoSizeMode       = RadAutoSizeMode.WrapAroundChildren;
            item.Children.Add(this.elementWithCaptionLayoutPanel);
            item.MaxSize = new Size(0, thisSize.ToSize().Height);
            item.MinSize = thisSize.ToSize();
            RadDropDownMenu menu = this.dropDownElement.DropDownMenu;
            //remove left column from Menu
            RadDropDownMenuElement menuPopup = (RadDropDownMenuElement)menu.PopupElement;
            StackLayoutPanel       menuStack = menuPopup.LayoutPanel as StackLayoutPanel;

            Debug.Assert(menuStack != null, "Chunk menu stack is null");
            menuStack.Orientation = this.Orientation;
            menuPopup.Layout.LeftColumnMinWidth = 0;
            this.dropDownElement.Items.Add(item);
            //fix for Missing theme if chunk is not expanded
            this.dropDownElement.Visibility = ElementVisibility.Visible;
            this.CollapseStep = (int)ChunkVisibilityState.Collapsed;
            menu.SetTheme();
            menu.MouseUp += new MouseEventHandler(this.menu_MouseUp);
        }
Beispiel #2
0
        public override AccessibleObject GetChild(int index)
        {
            RadDropDownMenu dropDownMenu = this.buttonElement.DropDownMenu;

            if (dropDownMenu != null && !dropDownMenu.IsLoaded)
            {
                dropDownMenu.LoadElementTree();
                dropDownMenu.SetTheme();
                dropDownMenu.RootElement.InvalidateMeasure(true);
                dropDownMenu.RootElement.UpdateLayout();
            }
            return((AccessibleObject)(this.buttonElement.Items[index] as RadMenuItemBase).AccessibleObject);
        }
        private void CollapseChunkToDropDown()
        {
            this.ExpandElementToStep(1);
            ExpandableStackLayout.InvalidateAll((RadElement)this);
            this.UpdateLayout();
            SizeF size = (SizeF)this.Size;

            this.elementWithCaptionLayoutPanel.SuspendThemeRefresh();
            this.Children.Remove((RadElement)this.elementWithCaptionLayoutPanel);
            this.elementWithCaptionLayoutPanel.ResumeThemeRefresh();
            RadRibbonBarGroup.RadGroupItem radGroupItem = new RadRibbonBarGroup.RadGroupItem();
            radGroupItem.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            radGroupItem.Children.Add((RadElement)this.elementWithCaptionLayoutPanel);
            radGroupItem.MinSize = new Size(size.ToSize().Width, radGroupItem.MinSize.Height);
            RadDropDownMenu        dropDownMenu = this.dropDownElement.DropDownMenu;
            RadDropDownMenuElement popupElement = (RadDropDownMenuElement)dropDownMenu.PopupElement;

            (popupElement.LayoutPanel as StackLayoutPanel).Orientation = this.Orientation;
            popupElement.Layout.LeftColumnMinWidth = 0;
            this.dropDownElement.Items.Add((RadItem)radGroupItem);
            this.dropDownElement.Visibility = ElementVisibility.Visible;
            this.CollapseStep = 4;
            dropDownMenu.SetTheme();
        }