I updated my SilverTwit code for my June 2009 Data Points column in MSDN Magazine to use the release version of Silverlight 3. The revised code can be retrieved in the codeplex site here. There were 3 sets of changes: (1) Twitter started using larger numbers for Ids, so I had to switch to use long instead of int and (2) the API for Out of Browser applications changed from beta to release and (3) the Out of Browser settings (formerly in the AppManifest.xml) changed.
Here are the changes since I posted the article, in case anyone is interested, in the Out of Browser API as they affect the article:
- ExecutionState enum replaced with InstallState enum
- In Application.Current:
- ExecutionStateChanged replaced by InstallStateChanged
- ExecutionState replaced by InstallState
- IsDetached replaced by IsRunningOutOfBrowser
- Detach replaced by Install
The new enums are slightly different and frankly I like the names of the members better than the old ones. For example, IsRunningOutOfBrowser is lengthy, but very clear. The whole “Detach” thing was not very clear and often confused people from feedback I received. Nevertheless, it is a set of changes.
I also had to change the settings for the Out of Browser aspects. The changes were very welcome indeed. Instead of manually editing the app.manifest file, you can now use a Out of Browser Settings window to edit them.
- First, since I was converting code form beta, I had to go into my app.manifest and clear out all of the Out of Browser settings.
- Next, I went to the properties of my Silverlight project and checked the checkbox on for Out of Browser (notice the yellow highlighted area in the image below)
- Finally, I clicked the Out of Browser button and edited the icon settings as well as the starting width and height of the browser. All of these settings are stored in a file called OutOfBrowserSettings.xml (instead of the AppManifest.xml)
The starting width and height were not available settings in the beta, so these are a truly welcome sight. Though I still wish we had more control over the chrome in out of browser apps.
That’s it … once I made these changes, the application runs fine. Of course, remember to edit the Page.xaml.cs file and enter your Twitter credentials in the constants so you can see your tweets.