Beispiel #1
0
        public override void ItemStateChanged(RadObject item, RadPropertyChangedEventArgs changeArgs)
        {
            string  str     = string.Empty;
            RadItem radItem = item as RadItem;

            if (radItem != null && !radItem.Enabled)
            {
                str = "Disabled";
            }
            RadCheckmark radCheckmark = item as RadCheckmark;

            if (radCheckmark.CheckState == ToggleState.On)
            {
                if (!string.IsNullOrEmpty(str))
                {
                    str += (string)(object)'.';
                }
                str += "ToggleState=On";
            }
            if (radCheckmark.CheckState == ToggleState.Indeterminate)
            {
                if (!string.IsNullOrEmpty(str))
                {
                    str += (string)(object)'.';
                }
                str += "ToggleState=Indeterminate";
            }
            this.SetItemState(item, str);
        }
Beispiel #2
0
        public override void ItemStateChanged(RadItem item, RadPropertyChangedEventArgs changeArgs)
        {
            string state = string.Empty;

            if (!item.Enabled)
            {
                state = "Disabled";
            }

            RadCheckmark check = item as RadCheckmark;

            if (check.CheckState == Telerik.WinControls.Enumerations.ToggleState.On)
            {
                if (!string.IsNullOrEmpty(state))
                {
                    state += ItemStateManagerBase.stateDelimiter;
                }
                state += "ToggleState=On";
            }
            if (check.CheckState == Telerik.WinControls.Enumerations.ToggleState.Indeterminate)
            {
                if (!string.IsNullOrEmpty(state))
                {
                    state += ItemStateManagerBase.stateDelimiter;
                }
                state += "ToggleState=Indeterminate";
            }

            base.SetItemState(item, state);
        }
 protected override void CreateChildElements()
 {
     this.checkmark = new RadCheckmark();
     this.checkmark.NotifyParentOnMouseInput = true;
     this.checkmark.ShouldHandleMouseInput   = true;
     this.checkmark.EnableVisualStates       = true;
     this.checkmark.Alignment = ContentAlignment.MiddleCenter;
     this.Children.Add((RadElement)this.checkmark);
 }
Beispiel #4
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive              = new FillPrimitive();
            this.fillPrimitive.Class        = "ButtonFill";
            this.fillPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

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

            this.textPrimitive = new TextPrimitive();
            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadCheckBoxElement.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 = "RadCheckBoxImagePrimitive";

            this.layoutPanel = new ImageAndTextLayoutPanel();
            this.layoutPanel.UseNewLayoutSystem = this.UseNewLayoutSystem;
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadCheckBoxElement.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadCheckBoxElement.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadCheckBoxElement.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadCheckBoxElement.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.SetValue(CheckBoxLayoutPanel.IsBodyProperty, true);

            this.layoutPanel.Children.Add(this.textPrimitive);
            this.layoutPanel.Children.Add(this.imagePrimitive);

            ImagePrimitive checkImagePrimitive = new ImagePrimitive();

            checkImagePrimitive.SetValue(RadCheckmark.IsImageProperty, true);
            checkImagePrimitive.Class = "RadCheckBoxCheckImage";

            this.checkMarkPrimitive       = new RadCheckmark();
            this.checkMarkPrimitive.Class = "CheckMark";
            this.checkMarkPrimitive.SetValue(CheckBoxLayoutPanel.IsCheckmarkProperty, true);
            this.checkMarkPrimitive.BindProperty(RadCheckmark.CheckStateProperty, this, RadCheckBoxElement.ToggleStateProperty, PropertyBindingOptions.OneWay);
            this.checkMarkPrimitive.CheckElement.Class = "RadCheckBoxCheckPrimitive";
            this.checkMarkPrimitive.Children.Add(checkImagePrimitive);

            CheckBoxLayoutPanel checkBoxPanel = new CheckBoxLayoutPanel();

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

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(checkBoxPanel);
            this.Children.Add(this.borderPrimitive);
        }
Beispiel #5
0
        protected override void CreateChildElements()
        {
            this.ButtonFillElement              = new FillPrimitive();
            this.ButtonFillElement.Class        = "ButtonFill";
            this.ButtonFillElement.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.BorderElement       = new BorderPrimitive();
            this.BorderElement.Class = "ButtonBorder";
            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 = "RadCheckBoxImagePrimitive";
            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);
            ImagePrimitive imagePrimitive = new ImagePrimitive();
            int            num12          = (int)imagePrimitive.SetValue(RadCheckmark.IsImageProperty, (object)true);

            imagePrimitive.Class          = "RadCheckBoxCheckImage";
            this.checkMarkPrimitive       = new RadCheckmark();
            this.checkMarkPrimitive.Class = "CheckMark";
            int num13 = (int)this.checkMarkPrimitive.SetValue(CheckBoxLayoutPanel.IsCheckmarkProperty, (object)true);
            int num14 = (int)this.checkMarkPrimitive.BindProperty(RadCheckmark.CheckStateProperty, (RadObject)this, RadToggleButtonElement.ToggleStateProperty, PropertyBindingOptions.OneWay);

            this.checkMarkPrimitive.CheckElement.Class = "RadCheckBoxCheckPrimitive";
            this.checkMarkPrimitive.Children.Add((RadElement)imagePrimitive);
            CheckBoxLayoutPanel checkBoxLayoutPanel = new CheckBoxLayoutPanel();
            int num15 = (int)this.TextElement.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);
            int num16 = (int)checkBoxLayoutPanel.BindProperty(RadElement.AutoSizeModeProperty, (RadObject)this, RadElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            int num17 = (int)checkBoxLayoutPanel.BindProperty(CheckBoxLayoutPanel.CheckAlignmentProperty, (RadObject)this, RadCheckBoxElement.CheckAlignmentProperty, 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);
        }