Note that there are some explanatory texts on larger screens.

plurals
  1. POXML Parsing Error in Window Phone
    primarykey
    data
    text
    <p>I'm creating a tweeter example in window phone and got <code>NullReferenceException</code></p> <p>I think it might be that the syntax is incorrect on the right side of the expression but couldn't tell what and why..</p> <p>Anyone has an idea why this resulted in error?</p> <p><strong>.xaml.cs:</strong></p> <pre><code>public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { string url = "http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=noradio"; WebClient twitter = new WebClient(); twitter.DownloadStringCompleted += new DownloadStringCompletedEventHandler(twitter_DownloadStringCompleted); twitter.DownloadStringAsync(new Uri(url)); } void twitter_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error != null) return; XElement xmlTweets = XElement.Parse(e.Result); listBox1.ItemsSource = from tweet in xmlTweets.Descendants("Status") select new TweeterItem { ImageSource = tweet.Element("user").Element("profile_image_url").Value, Message = tweet.Element("text").Value, UserName = tweet.Element("user").Element("screen_name").Value, }; } </code></pre> <p><strong>.xaml:</strong></p> <pre><code>&lt;ListBox Height="521" HorizontalAlignment="Left" Margin="0,131,0,0" Name="listBox1" VerticalAlignment="Top" Width="476"&gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel Orientation="Horizontal" Height="132"&gt; &lt;Image Source="{Binding ImageSource}" Height="73" Width="73" VerticalAlignment="Top" Margin="0,10,8,0"/&gt; &lt;StackPanel Width="370"&gt; &lt;TextBlock Text="{Binding UserName}" Foreground="#FFC8AB14" FontSize="28" /&gt; &lt;TextBlock Text="{Binding Message}" TextWrapping="Wrap" FontSize="24" /&gt; &lt;/StackPanel&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload