A couple of gotchas for creating Windows Phone 7 Applications
August 9, 2011 Leave a comment
I have been doing Nathan’s Transforms and Animations projects. I made a typo when naming a Storyboard (note the space as the 1st character) and when I tried to auto-generate the code behind function:
I got this error:
Notice how there is a space between the ‘ and the P -> however, if you are typing/reading fast, you might miss it.
Another gotcha I found was in Chapter 16, when coding up the DoubleAnimationUsingKeyFrames. I copied the code verbatim from his book and I got this:
When I added an x:name, the compiler was once again happy.
My final gotcha looked like this:
And the offending line is in the LotteryBall.Percolating Setter:
Storyboard.SetTargetProperty(this.percolatingStoryboard, new PropertyPath("Y"));
WTF? How can you set a property path to a property that doesn’t exist? I ran the code sample and it works! Ugh, I am at a loss. He has a Y property in the Tilt class that I didn’t include because it is non-essential. Oh well, it would have been cool to see the final solution work…