Skip to main content

How to: Use Custom Parameters

  • 2 minutes to read

This example shows you how to create a parameter that is used to provide custom scaling for elements along the path and during transition animations. Two new function classes are declared. One is used to increase the element size from the start to the end of the path. Another provides zooming animation effects for element transitions. These functions, and one built-in function, are used to initialize a custom parameter. XAML code then binds the parameter to scaling transformation properties. See Lesson 4 - Using Functions and Parameters for details.

public class MyScaleDistributionFunction : DevExpress.Xpf.Carousel.FunctionBase {
    protected override double GetValueOverride(double x) {
        return x * x * 0.8 + 0.2;
    }
}
public class MyScaleAnimationFunction : DevExpress.Xpf.Carousel.FunctionBase {
    protected override double GetValueOverride(double x) {
        if (x < 0.5)
            return x + 1;
        return 2 - x;
    }
}