示例#1
0
        protected override void CreateChildElements()
        {
            this.SetDefaultValueOverride(TextImageRelationProperty, TextImageRelation.ImageBeforeText);

            // fill
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add(this.fillPrimitive);

            // border
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuItemBorderPrimitive";
            this.Children.Add(this.borderPrimitive);

            // layout
            this.layout       = new RadMenuItemLayout();
            this.layout.Class = "RadMenuItemLayout";
            this.Children.Add(layout);

            // bindings
            layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            layout.Checkmark.BindProperty(RadCheckmark.CheckStateProperty, this, RadMenuItem.CheckStateProperty, PropertyBindingOptions.OneWay);
            layout.Text.BindProperty(TextPrimitive.TextProperty, this, RadButtonItem.TextProperty, PropertyBindingOptions.OneWay);
            layout.Description.BindProperty(TextPrimitive.FontProperty, this, RadMenuItem.DescriptionFontProperty, PropertyBindingOptions.OneWay);
            layout.Shortcut.BindProperty(TextPrimitive.TextProperty, this, RadMenuItem.HintTextProperty, PropertyBindingOptions.OneWay);
            layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
        }
示例#2
0
        protected override void CreateChildElements()
        {
            int num1 = (int)this.SetDefaultValueOverride(RadButtonItem.TextImageRelationProperty, (object)TextImageRelation.ImageBeforeText);

            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add((RadElement)this.fillPrimitive);
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuItemBorderPrimitive";
            this.Children.Add((RadElement)this.borderPrimitive);
            this.layout       = new RadMenuItemLayout();
            this.layout.Class = "RadMenuItemLayout";
            this.Children.Add((RadElement)this.layout);
            int num2  = (int)this.layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num3  = (int)this.layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            int num4  = (int)this.layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            int num5  = (int)this.layout.Checkmark.BindProperty(RadCheckmark.CheckStateProperty, (RadObject)this, RadMenuItem.CheckStateProperty, PropertyBindingOptions.OneWay);
            int num6  = (int)this.layout.Text.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.OneWay);
            int num7  = (int)this.layout.Text.BindProperty(VisualElement.ForeColorProperty, (RadObject)this, VisualElement.ForeColorProperty, PropertyBindingOptions.TwoWay);
            int num8  = (int)this.layout.Description.BindProperty(VisualElement.FontProperty, (RadObject)this, RadMenuItem.DescriptionFontProperty, PropertyBindingOptions.OneWay);
            int num9  = (int)this.layout.Shortcut.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadMenuItem.HintTextProperty, PropertyBindingOptions.OneWay);
            int num10 = (int)this.layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, (RadObject)this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            int num11 = (int)this.layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            int num12 = (int)this.layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            int num13 = (int)this.layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, (RadObject)this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
        }