コード例 #1
0
        //TODO: Check whether everything is working
        //protected override void OnFontChanged(EventArgs e)
        //{
        //    base.OnFontChanged(e);
        //    this.ToggleHTML(this.Text);
        //}

        protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
        {
            if (e.Property == TextPrimitive.TextProperty)
            {
                this.textWithoutMnemonics = TelerikHelper.TextWithoutMnemonics((string)e.NewValue);

                this.ToggleHTML(this.textWithoutMnemonics);
            }
            else if (e.Property == AlignmentProperty || e.Property == FontProperty || e.Property == ForeColorProperty)
            {
                this.ToggleHTML(this.textWithoutMnemonics);
            }
            else if (e.Property == RadElement.AutoSizeModeProperty)
            {
                RadAutoSizeMode newAutoSizeMode = (RadAutoSizeMode)e.NewValue;
                if (newAutoSizeMode == RadAutoSizeMode.WrapAroundChildren)
                {
                    this.TextAlignment = ContentAlignment.MiddleLeft;
                }
                else if (newAutoSizeMode == RadAutoSizeMode.FitToAvailableSize)
                {
                    this.TextAlignment = ContentAlignment.TopLeft;
                }
            }

            base.OnPropertyChanged(e);
        }
コード例 #2
0
 internal static object Box(RadAutoSizeMode value)
 {
     if (value == RadAutoSizeMode.Auto)
     {
         return(AutoSizeModeBoxes.AutoBox);
     }
     if (value == RadAutoSizeMode.WrapAroundChildren)
     {
         return(AutoSizeModeBoxes.WrapAroundChildrenBox);
     }
     return(AutoSizeModeBoxes.FitToAvailableSizeBox);
 }
コード例 #3
0
        private void SetViewportAutoSizeMode()
        {
            if (this.viewport == null)
            {
                return;
            }
            this.viewport.BypassLayoutPolicies = true;
            RadAutoSizeMode autoSizeMode = this.viewport.AutoSizeMode;

            if (this.UsePhysicalScrolling || this.AutoSizeMode == RadAutoSizeMode.WrapAroundChildren)
            {
                this.viewport.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            }
            if (autoSizeMode != this.viewport.AutoSizeMode)
            {
                return;
            }
            this.InvalidateMeasure();
        }
コード例 #4
0
        private void SetViewportAutoSizeMode()
        {
            if (this.viewport == null)
            {
                return;
            }

            this.viewport.BypassLayoutPolicies = true;

            RadAutoSizeMode oldViewportAutoSizeMode = this.viewport.AutoSizeMode;

            if (this.UsePhysicalScrolling || this.AutoSizeMode == RadAutoSizeMode.WrapAroundChildren)
            {
                this.viewport.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            }
            if (oldViewportAutoSizeMode == this.viewport.AutoSizeMode)
            {
                this.IsLayoutInvalidated = true;
                PerformLayout(this);
            }
        }