Upgrade to Silverlight Beta 2

Location: BlogsRainer's BlogSilverlight   
Posted by: Rainer Stropek2008-09-09 10:25:56Z

In Silverlight 2.0 Beta 1 you could call Storyboard.SetTargetProperty in this way:

Storyboard.SetTargetProperty( cloudAnimationX, "X" );

Silverlight 2.0 Beta 2 does not support this any more. A corresponding note is included in the Breaking Changes article in MSDN. According to this article the correct call looks like this:

Storyboard.SetTargetProperty( cloudAnimationX, new PropertyPath("X") );

However, if you look up the constructor of PropertyPath in MSDN the function signature looks differently:

PropertyPath Constructor in MSDN

IntelliSense also demands two parameters for PropertyPath's constructor:

IntelliSense for PropertyPath's Constructor

The following code does compile, yet it throws a null reference exception:

Storyboard.SetTargetProperty( cloudAnimationX, new PropertyPath("X", null) );

My conclusion: Ignore the documentation of PropertyPath's constructor and IntelliSense and use the syntax with one parameter! This version compiles and runs without error.

Permalink | Trackback

Your name:
Title:
Comment:
Add Comment  Cancel 

Search Blog

Blog List

Blog Archive