AnimatedPropertySetting changed...

2 posts, 0 answers
  1. Karl Golling
    Karl Golling avatar
    226 posts
    Member since:
    Jun 2005

    Posted 05 Jul 2012 Link to this post

    I just upgraded to the latest version 608.40 and there seems to be a change in the animatedpropertysettings. What changes do I have to make adapt? 

    Thanks, Karl
    private void ZoomItem(RadButtonElement button)
    {
        shouldZoomSelectedItem = false;
        Size size = this.radCarousel1.CarouselElement.ItemsContainer.Size;
     
        CarouselContentItem contentItem = (CarouselContentItem)button.Parent;
     
        zoomedItem = contentItem;
     
        button.ButtonFillElement.Visibility = ElementVisibility.Collapsed;
     
        currScaleFactor = Math.Min(
            ((float)size.Width) / button.Size.Width / 2f,
            ((float)size.Height) / button.Size.Height / 2f);
     
        AnimatedPropertySetting scaleChange = new AnimatedPropertySetting(
            RadElement.ScaleTransformProperty,
            new SizeF(currScaleFactor, currScaleFactor),
            5,
            20
            );
     
        scaleChange.AnimationFinished += new AnimationFinishedEventHandler(scaleChange_AnimationFinished);
     
        SizeF offset = new SizeF(
            (size.Width - contentItem.Size.Width * currScaleFactor) / 2f - contentItem.Location.X,
            (size.Height - contentItem.Size.Height * 0.50f * currScaleFactor) / 2f - contentItem.Location.Y);
     
        AnimatedPropertySetting positionChange = new AnimatedPropertySetting(
            RadElement.PositionOffsetProperty,
            offset,
            5,
            20
            );
     
        scaleChange.ApplyValue(contentItem);
        positionChange.ApplyValue(contentItem);
    }
  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 09 Jul 2012 Link to this post

    Hi Karl,

    Thank you for writing.

    In our latest release we introduced a new theme engine which improves the performance of the application and lowers its memory consumption. Find further details in our dedicated blog. Because of the changes we removed some of the constructors of the AnimatedPropertySetting class. In this case you should explicitly set the startValue argument to null. Here is the changed code:
    private void ZoomItem(RadButtonElement button)
    {
        shouldZoomSelectedItem = false;
        Size size = this.radCarousel1.CarouselElement.ItemsContainer.Size;
     
        CarouselContentItem contentItem = (CarouselContentItem)button.Parent;
     
        zoomedItem = contentItem;
     
        button.ButtonFillElement.Visibility = ElementVisibility.Collapsed;
     
        currScaleFactor = Math.Min(
            ((float)size.Width) / button.Size.Width / 2f,
            ((float)size.Height) / button.Size.Height / 2f);
     
        AnimatedPropertySetting scaleChange = new AnimatedPropertySetting(
            RadElement.ScaleTransformProperty,
            null,
            new SizeF(currScaleFactor, currScaleFactor),
            5,
            20
            );
     
        scaleChange.AnimationFinished += new AnimationFinishedEventHandler(scaleChange_AnimationFinished);
     
        SizeF offset = new SizeF(
            (size.Width - contentItem.Size.Width * currScaleFactor) / 2f - contentItem.Location.X,
            (size.Height - contentItem.Size.Height * 0.50f * currScaleFactor) / 2f - contentItem.Location.Y);
     
        AnimatedPropertySetting positionChange = new AnimatedPropertySetting(
            RadElement.PositionOffsetProperty,
            null,
            offset,
            5,
            20
            );
     
        scaleChange.ApplyValue(contentItem);
        positionChange.ApplyValue(contentItem);
    }

    If you experience any issues with the new version, do not hesitate to contact us.

    Kind regards,
    Jack
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top