Yup–at 12:01 AM on March 19th, 2011, I submitted for publication my first application ever. No surprises that not much new functionality was added before submission–the main screen hasn’t changed at all, in fact. What was changed, with a lot of help from Tim and Dave, was the creation of a custom control that held my splashscreen image and had a timer attached to it. Yes, this is probably pretty trivial for anyone with real development experience, but I am still wrapping my head around it.
Why did I have to do this? Well, it turns out that the splashscreen in Windows Phone 7 loads and then disappears as soon as the app is loaded. Normally, this is a good thing. When your app is less than 400 lines of code soaking wet, it means your splashscreen is gone in about 17 nanoseconds. Since I was able to find a great creative commons image to use for the splashscreen, I thought people might want to see it for just a second or two, so I embarked over the last few days in between work and personal time off for a sick wife, on finding a solution that would keep that splashscreen on longer.
To make a long story short, my first efforts failed. There is no property defined in Windows Phone 7 that will allow you to simply say “I want my splashscreen on *this* long.” So the next approach was to create a grid control on a new page, set the timer on that page, and then fill that grid with my splashscreen image. That didn’t work for a few reasons, but was problematic regardless. You see, one of the fundamentally cool things about Windows Phone 7 is the smart back button. If you’re in an app, it just seems to know whether you want to go back a screen, or back to your application page, or wherever else you came from. If you do as I tried to do (I failed–the timer would be counting, but somehow never delayed things), you’ll find your back arrow will take you to your splash screen instead of exit the application. That’s not good.
The next try was to try duplicate the landing page approach above by using a control (stackpanel, this time) that sat over the top of the entire UI and went away with the timer with a Visibility.Collapsed slight of hand. The timer worked this time, but for some reason the stackpanel would only display black instead of my image. So strike two.
The third attempt was really Dave figuring this out–create a custom control, pasting the image on it, and create a custom method that made it pop up and disappear based on the timer. Since Dave did nearly all the code here (in an infuriatingly short period of time), I’m still trying to figure out a few things about where things were defined, but it worked and worked very, very well. So thanks, Dave!
I’ll update when it is in the marketplace (or if it gets rejected), and then I’ll talk more about he next apps I’m building.