Esempio n. 1
0
        /// <summary>
        /// initializes and adds the child elements
        /// </summary>
        protected override void CreateChildElements()
        {
            this.fillPrimitive              = new FillPrimitive();
            this.fillPrimitive.Class        = "radioButtonFill";
            this.fillPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "radioButtonBorder";

            this.textPrimitive = new TextPrimitive();
            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadItem.TextProperty, PropertyBindingOptions.TwoWay);

            this.imagePrimitive = new ImagePrimitive();
            this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadCheckBoxElement.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadCheckBoxElement.ImageProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadCheckBoxElement.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.Class = "radioButtonLayoutImagePrimitive";

            this.layoutPanel = new ImageAndTextLayoutPanel();
            this.layoutPanel.UseNewLayoutSystem = this.UseNewLayoutSystem;
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadRadioButtonElement.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadRadioButtonElement.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadRadioButtonElement.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadRadioButtonElement.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.SetValue(CheckBoxLayoutPanel.IsBodyProperty, true);
            this.layoutPanel.Children.Add(this.textPrimitive);
            this.layoutPanel.Children.Add(this.imagePrimitive);

            RadioPrimitive radioPrimitive = new RadioPrimitive();

            radioPrimitive.SetValue(RadRadiomark.IsCheckmarkProperty, true);
            radioPrimitive.Class = "radioButtonPrimitive";

            ImagePrimitive radioImagePrimitive = new ImagePrimitive();

            radioImagePrimitive.SetValue(RadRadiomark.IsImageProperty, true);
            radioImagePrimitive.Class = "radioButtonImagePrimitive";

            this.checkMarkPrimitive = new RadRadiomark();
            this.checkMarkPrimitive.SetValue(CheckBoxLayoutPanel.IsCheckmarkProperty, true);
            this.checkMarkPrimitive.BindProperty(RadRadiomark.CheckStateProperty, this, RadCheckBoxElement.ToggleStateProperty, PropertyBindingOptions.OneWay);
            this.checkMarkPrimitive.Children.Add(radioPrimitive);
            this.checkMarkPrimitive.Children.Add(radioImagePrimitive);
            this.checkMarkPrimitive.NotifyParentOnMouseInput = true;
            this.checkMarkPrimitive.ShouldHandleMouseInput   = false;

            CheckBoxLayoutPanel radioButtonPanel = new CheckBoxLayoutPanel();

            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            radioButtonPanel.BindProperty(CheckBoxLayoutPanel.AutoSizeModeProperty, this, RadRadioButtonElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            radioButtonPanel.BindProperty(CheckBoxLayoutPanel.CheckAlignmentProperty, this, RadRadioButtonElement.RadioCheckAlignmentProperty, PropertyBindingOptions.OneWay);
            radioButtonPanel.Children.Add(layoutPanel);
            radioButtonPanel.Children.Add(this.checkMarkPrimitive);

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(radioButtonPanel);
            this.Children.Add(this.borderPrimitive);
        }
        protected override void CreateChildElements()
        {
            this.ButtonFillElement              = new FillPrimitive();
            this.ButtonFillElement.Class        = "radioButtonFill";
            this.ButtonFillElement.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.BorderElement       = new BorderPrimitive();
            this.BorderElement.Class = "radioButtonBorder";
            this.TextElement         = new TextPrimitive();
            int num1 = (int)this.TextElement.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);
            int num2 = (int)this.TextElement.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.TwoWay);

            this.ImagePrimitive = new ImagePrimitive();
            int num3 = (int)this.ImagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);
            int num4 = (int)this.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num5 = (int)this.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            int num6 = (int)this.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.ImagePrimitive.Class = "radioButtonLayoutImagePrimitive";
            this.LayoutPanel          = new ImageAndTextLayoutPanel();
            int num7  = (int)this.LayoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, (RadObject)this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            int num8  = (int)this.LayoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            int num9  = (int)this.LayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            int num10 = (int)this.LayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, (RadObject)this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            int num11 = (int)this.LayoutPanel.SetValue(CheckBoxLayoutPanel.IsBodyProperty, (object)true);

            this.LayoutPanel.Children.Add((RadElement)this.TextElement);
            this.LayoutPanel.Children.Add((RadElement)this.ImagePrimitive);
            RadioPrimitive radioPrimitive = new RadioPrimitive();
            int            num12          = (int)radioPrimitive.SetValue(RadRadiomark.IsCheckmarkProperty, (object)true);

            radioPrimitive.Class = "radioButtonPrimitive";
            ImagePrimitive imagePrimitive = new ImagePrimitive();
            int            num13          = (int)imagePrimitive.SetValue(RadRadiomark.IsImageProperty, (object)true);

            imagePrimitive.Class    = "radioButtonImagePrimitive";
            this.checkMarkPrimitive = new RadRadiomark();
            int num14 = (int)this.checkMarkPrimitive.SetValue(CheckBoxLayoutPanel.IsCheckmarkProperty, (object)true);
            int num15 = (int)this.checkMarkPrimitive.BindProperty(RadRadiomark.CheckStateProperty, (RadObject)this, RadToggleButtonElement.ToggleStateProperty, PropertyBindingOptions.OneWay);

            this.checkMarkPrimitive.Children.Add((RadElement)radioPrimitive);
            this.checkMarkPrimitive.Children.Add((RadElement)imagePrimitive);
            this.checkMarkPrimitive.NotifyParentOnMouseInput = true;
            this.checkMarkPrimitive.ShouldHandleMouseInput   = false;
            CheckBoxLayoutPanel checkBoxLayoutPanel = new CheckBoxLayoutPanel();
            int num16 = (int)this.TextElement.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);
            int num17 = (int)checkBoxLayoutPanel.BindProperty(RadElement.AutoSizeModeProperty, (RadObject)this, RadElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            int num18 = (int)checkBoxLayoutPanel.BindProperty(CheckBoxLayoutPanel.CheckAlignmentProperty, (RadObject)this, RadRadioButtonElement.RadioCheckAlignmentProperty, PropertyBindingOptions.OneWay);

            checkBoxLayoutPanel.Children.Add((RadElement)this.LayoutPanel);
            checkBoxLayoutPanel.Children.Add((RadElement)this.checkMarkPrimitive);
            this.Children.Add((RadElement)this.ButtonFillElement);
            this.Children.Add((RadElement)checkBoxLayoutPanel);
            this.Children.Add((RadElement)this.BorderElement);
        }
Esempio n. 3
0
 private void AsureImageAndCheckElements()
 {
     if (this.imageElement == null || this.checkElement == null)
     {
         foreach (RadElement child in this.GetChildren(ChildrenListOptions.Normal))
         {
             if ((bool)child.GetValue(RadRadiomark.IsImageProperty))
             {
                 this.imageElement = child as ImagePrimitive;
             }
             else if ((bool)child.GetValue(RadRadiomark.IsCheckmarkProperty))
             {
                 this.checkElement = child as RadioPrimitive;
             }
         }
     }
     this.SetCheckState();
 }