Я пытаюсь создать динамически загружаемую ссылку в окне списка с помощью привязки.
Inicio.xaml.cs
void cardeek_DownloadUrlCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error != null) return;
textBox1.Text = e.Result;
XElement xmlUrl = XElement.Parse(e.Result);
listBox1.ItemsSource = from url in xmlUrl.Descendants("user")
select new TwitterItem { Url = url.Element("card").Element("url").Value, };
}
private void ContentPanel_Loaded(object sender, RoutedEventArgs e)
{
WebClient cardeekUrl = new WebClient();
cardeekUrl.DownloadStringCompleted += new DownloadStringCompletedEventHandler(cardeek_DownloadUrlCompleted);
cardeekUrl.DownloadStringAsync(new Uri("http://www.cardeek.com/wp7/response_url.php?email=" + "david.sonike@gmail.com" + "&code=" + "1"));
}
void cardeek_DownloadUrlCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error != null)
return;
textBox1.Text = e.Result;
XElement xmlUrl = XElement.Parse(e.Result);
listBox1.ItemsSource = from url in xmlUrl.Descendants("user")
select new TwitterItem
{
Url = url.Element("card").Element("url").Value,
};
}
private void ContentPanel_Loaded(object sender, RoutedEventArgs e)
{
WebClient cardeekUrl = new WebClient();
cardeekUrl.DownloadStringCompleted += new DownloadStringCompletedEventHandler(cardeek_DownloadUrlCompleted);
cardeekUrl.DownloadStringAsync(new Uri("http://www.cardeek.com/wp7/response_url.php?email=" + "david.sonike@gmail.com" + "&code=" + "1"));
}
Inicio.xaml
<ListBox Height="416" HorizontalAlignment="Left" Margin="41,191,0,0" Name="listBox1" VerticalAlignment="Top" Width="367">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Background="{Binding coItemBackground}">
<phone:WebBrowser HorizontalAlignment="Left" Margin="69,140,0,0" VerticalAlignment="Top" Height="121"
Width="137" Source="{Binding Url}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
и Xml-источник в Интернете
www.marca.com
www.elmundo.com
www.vidaextra.com
В моем эмуляторе Windows Phone 7 ничего не видно, кто-нибудь может помочь мне решить проблему? 101