This is a migrated thread and some comments may be shown as answers.

AnimatedPropertySetting changed...

1 Answer 160 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 05 Jul 2012, 10:15 AM
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);
}

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 09 Jul 2012, 12:33 PM
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 >>
Tags
Carousel
Asked by
Karl
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or