Hello all this my first blog I hope find it useful
- 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
- Right click on your project then select Manage NuGet Packages
- chose Online then Search for MVVM Light then click install as you see
- check you references to make sure MVVM light successfully installed as you see
- then add new folder named “Model” and Class Named “NewsItemModel”
- i will create the model class with the Following code don’t forget to make Class public Like me 😀
- 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
- 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
- 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 post
- go to app.xaml and move locator as you see in this pic
- go to Mainpage.xaml to link your view page with MainViewModel class using databinding DataContext=”{Binding Main, Source={StaticResource Locator}}
- 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
-
- finally thanks for reading you will find the full example with source code here http://sdrv.ms/ZrNEy3
Reblogged this on Windows Phone Fiends.
Thanks for your code…I have few questions though. How an I contact you?
thanks, this my email aly.ahmed@outlook.com