While working on the last part of the WPF/E QuickStart, I was doing my thing which is normally thinking of other stuff to try to do with the sample code. The slider looked like fun, and I thought if I started it in the center instead of on the left that would be interesting. The outer Canvas in the xaml already had a Loaded= line in it, so I simply used it to try to set the center.
'Loaded' was pointed at "javascript::slider_loaded. That in turn called slider_SetValue. So I changed this call to pass 100 instead of 0.
And it didn't work. Hmmm
A couple of alerts pointed out more than one problem with the original code:
- The Loaded= line in the xaml calls out "slider_loaded", but the actual javascript is named "slider_Loaded", so no matter what the value was set to, it wasn't being called.
- Once I had that repaired, it still wasn't working because the call from slider_Loaded to slider_SetValue was passing 'slider' instead of 'sender'. There is no variable named 'slider'.
These are both reasonably minor, but if someone is trying to use the QuickStart code as a springboard to other things, it will slow them down.
I downloaded the latest WPF/E QuickStart and documentation from late December, and the problems are still there.
This article is essentially mirrored on my site in the WPF/E Tutorial section:
http://www.wynapse.com/WPFE/Tutor/Minor_QuickStart_Errors.aspx
posted @ Wednesday, January 17, 2007 8:28 PM