Thursday, October 16, 2008

Silverlight puzzle update and issues


Updated silverlight puzzle to use the release version of silverlight 2.



The only issue with the upgrade was that using "storyBoard.SkipToFill()" does not stop the animation in the new version - this generated an exception:



A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.dll

Additional information: Operation is not valid on an active Animation or Storyboard. Root Storyboard must be stopped first.



This exception was caused by trying to resue the same animation, in the beta SkipToFill also stopped the animation. Adding a "storyBoard.Stop()" after the SkipToFill() fixed this. However this caused a side-effect. It appears that in the beta SkipToFill actually updates the DependencyProperty, what does this mean?

In my beta code I relied on using the animation to "move" the visual tile from one position to another. In the release version once the animation was removed (i.e. applied to a different object) the tile would snap back to its original position. My work around this was to set the tiles position before the animation - this would mean that the tile would be at the correct location after the animation (or if the animation was removed).

1 comment:

Vajda said...

Hi there, this app is awesome!