The mysteries of extending the WPF animation classes -


There is a property on the Silverlight's animation timetable (like Double Animation) which is called simplification that allows you to specify a function Allows two values ​​with which Although it is coming in .NET 4, I want to shut it down from 3.5 After reading, it feels great, but I am having a strange problem.

I am expanding double animation like this:

  class EasingDoubleAnimation: DoubleAnimation {protected override Freezable CreateInstanceCore () {Return New EasingDoubleAnimation (); } Secure Override Double GateCurrentValuere (Double Default Origin Value, Double Default Destination Value, AnimationClock AnimationClock) {debug.rooteline (animationclock.content.product.vill); Return base GetCurrentValueCore (defaultOriginValue, defaultDestinationValue, animationclock); } Public Relativity FunctionBase Easing {Receiving (EasingFunctionBase) GetValue (EasingFunctionProperty);} Set {SetValue (EasingFunctionProperty, value);} Dependency reinforcement for public static reading functioning = Dependency Property. Registrar ("Easy", Typef (Ease work), typef (simplicity doubling), new property matadata (null));}  

Note that this is nothing interesting than adding a new asset.

And then I Some code can be used in:

  Storyboard SB = new storyboard (); EasingDoubleAnimation ease = new EasingDoubleAnimation (); // reduce.existingfunction = new backage (); storyboards. Ease, My Target); Storyboard CertificateProperties (Easy, New Property Path ("(Canvas. Left)"); For ease = 100; Rest. Duration = Timespace. Formsconds (3); Sb.Children.Add Ease); sb.Begin ();  

This code runs animation properly.

But, if I do the assignment to the line which works smoothly, the animation does not run anymore. My CreateInstanceCore method is called, but GetCurrentValue is never asked. strange?

Just take a shot here in the dark. Try changing the type of property into a simple type ( int / string ) I suspect that there may be something like this with the fact that your property type EasingFunctionBase and you are trying to stabilize this example.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -