Will Web 3.0 Replace Web 2.0?
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Abhishek Kumar Ravi
210
11.5k
4.2m
Why i 'm getting this NULL return | XML File
Feb 15 2014 3:34 PM
I have a XML which i want to parse. But, for some reasons its not working.
public Events()
{
InitializeComponent();
StreamResourceInfo xml = Application.GetResourceStream(new Uri("News.xml",UriKind.RelativeOrAbsolute));
data = XElement.Load(xml.Stream); // ERROR
this.ManipulationStarted += new EventHandler<ManipulationStartedEventArgs>(Events_ManipulationStarted);
}
void Events_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
{
var events = from item in data.Elements("Event") select item;
foreach( XElement temp in events )
{
eventItem.Add(new Model()
{
name =temp.Element("Name").Value,
image = temp.Element("Image").Value,
date = temp.Element("Date").Value,
time = temp.Element("Time").Value
});
myList.ItemsSource = eventItem;
}
}
Reply
Answers (
2
)
New Programmer.
WordFind Puzzle