Introduction

This app started (and mostly remains) as a quick and dirty port of Luc Pattyn'sCPVanity app to the Windows Phone 7 platform. Once that was done, it just seemed lacking an RSS reader of codeProject articles and forums.

Why? Because if we don't have one already, we definitely need one!

Background

To do the port of CPVanity, three files were copied from the desktop version:

Article.cs

User.cs

CPSite.cs

Prerequisites

There are some things you will need to have in order to play around with this code:

In order to get CPSite (where the HTML content is downloaded and scraped) to work, some small changes were needed. First of all, the desktop version tells the CPSite class to do its work on a background thread. CPSite then creates the HttpWebRequests on that thread and downloads synchronously on that thread. Since all WP7 web communication is asynchronous at the point where it is invoked, the background threading needed to be moved into that class.

View to ViewModel Binding

Though the MVVM ViewModelLocator works quite well when there is a 1:1 mapping between the View and the View Model, it doesn't work quite so well when you want to reuse a Page to render different ViewModels. The ViewModelLocator is set statically in the XAML, creating the 1:1 binding.

Since the rendering of the forum and article RSS feeds is identical and the ViewModels (and definitely the Models behind those) are slightly different, I ended up with one page and two ViewModels.

To get around the 1:1 mapping in ViewModelLocator, an Attribute is used to mark up the ViewModel:

The linkage between View and the ViewModel is still declarative and loosely coupled, but it also has an additional degree of freedom which seems advantageous in that a single page can render any ViewModel as long at it exposes two properties: Name and Items.

Points of Interest

The most interesting thing I learned is that once you figure out the platform, WP7 development is very easy. This took all of a couple of hours to get together (of course, plagiarizing much of the original work wholesale).

History

12/14/2010 - Initial upload.

12/17/2010 - Added progress bar and bigger rep image page.

12/27/2010 - Added RSS reader.

1/17/2013 - Tested on WP8, updated for site changes, bug fixes, removed from Game Hub

For some reason my intial submission got categorized as a game! I'm not sure if that was my mistake during the submit or if something got hosed up on the backend (or maybe they saw the cute cp icon and figured it must be a game) but if you go to the Games hub you should see it there.

I'm working on updating that submission and hoping it will be in the hub in the enxt week or so.