How To Read From rss Feed In Windows Phone 8 Using MVVM Light with syndication

Hello all this my first blog I hope find it useful

  1. Create new project , Select Windows Phone ,then select windows phone app and  give it a name  “MasrawyNewsReader” ,click ok will show new dialog box choose windows phone 8 and click ok
  2. Right click on your project then select Manage NuGet Packages
  3. chose Online then   Search for MVVM Light then click install  as you see nuget
  4. check you references to make sure MVVM light successfully installed as you seereferences
  5. then add new folder named “Model” and Class Named “NewsItemModel” ModelClass
  6. i will create the model class with the Following code don’t forget to make Class public Like me 😀 ModelClass
  7. then open mainviewmodel.cs you will find it in view model folder the add the following code i just add new property to use it in binding if you not familiar with binding I will explain it in single topic   viewmodel

  8. then add reference to this Syndication dll by Right click on references on solution explorer then click add reference click browse button and locate the dll from this path   C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.ServiceModel.Syndication.dll then select it and click add Select refrance
    Chose refrance
  9. then adding methods to get the data from feed in mainviewmodel.cs
    as the following code you will find the full code example in the last of this postmainviewmodel
  10. go to app.xaml and move locator as you see in this pic Locator
  11. go to Mainpage.xaml to link your view  page with MainViewModel class using databinding  DataContext=”{Binding Main, Source={StaticResource Locator}}locator binding
  12. then i create list box and bind news to it and create data template to create each item view then create blue grid to view when no data loaded the final app photos
  13.   loading viewpagewithnews
  14. finally thanks for reading you will find the full example with source code  here http://sdrv.ms/ZrNEy3

4 thoughts on “How To Read From rss Feed In Windows Phone 8 Using MVVM Light with syndication

Leave a comment