Here I am checking whether there is a result for the URL used for feed content retrieval. If the item is not null and so are its main used properties , then a new instance of ItemModel is created for each item and added to the item collection.
This way, the feed contents are updated when the user navigates away from the feed list. Since there is an event handler declared in XAML, all you need is to provide a method call in the code-behind:.
If you launch the application and add a few valid feeds, then when the list is reloaded, you will see the content aggregated there. Now, the application seems to be useful, but not to the extent it could be. Each syndication item is pointing to an actual published post. So why not open that post in a new page? To do this, add a new Portrait Page and name it DetailsView. Now, you need to modify the existing ItemModel class to include one more property — ItemLink , that will store an assigned post link.
The property along with the associated private field should look like this:. Now, on the page that you recently created DetailsView , inside the internal grid, add a WebBrowser control. My grid markup looks like this:. All good by this point, but there is an event handler needed for the ListBox on the main page, so that when one item is clicked, it navigates to the page with the web browser and opens the assigned page.
In order to do this, make sure that the ListBox on the main page has an associated SelectionChanged event handler:. I am passing a parameter with the currently selected item index, so on the page with the web browser I need to read this parameter and get the URL from the item collection.
I can do this simply by using the Loaded event handler for that page:. And that is it. Once you launch the application, reload the feeds and click on any item. You will see the details page open and the associated link navigated to in the WebBrowser control:. If you want to download the project, you can do so by clicking here [ZIP file — Visual Studio solution]. Of course, Windows Phone 7 Development Tools are required. SyndicationClient in a Silverlight 8.
Linq and SyndicationClient do different things. In many cases you would use them together, although you can also use each separately. Well, that's odd. The project I was working on wouldn't let me reference the Windows. SyndicationClient without adding the v4 sdk but, I just created a new project and all worked just fine. I wouldn't have minded using Linq as it gives a little more control but, SyndicationClient is just so simple for the small bit I need it for.
Thanks for the response. I had been banging my head and had all but decided to switch over to a standard Windows Phone app. The content you requested has been removed. Star View license. Branches Tags. Could not load branches. Could not load tags. Latest commit. Git stats 8 commits. Failed to load latest commit information. View code. Press F5 to build the project and run it on the Windows Phone Emulator.
Important files: File Description FeedPivot.
0コメント