如何在xaml中显示联系人的这些图片? void\u appContacts\u搜索已完成(对象发送者、联系人搜索者) { foreach(e.Results中的var结果) { var stream=result.GetPicture(); if(流!=null) { BitmapImage bmp=新的BitmapImage(); bmp.SetSource(流); 图像img=新图像(); img.Source=bmp; } } }

如何在xaml中显示联系人的这些图片? void\u appContacts\u搜索已完成(对象发送者、联系人搜索者) { foreach(e.Results中的var结果) { var stream=result.GetPicture(); if(流!=null) { BitmapImage bmp=新的BitmapImage(); bmp.SetSource(流); 图像img=新图像(); img.Source=bmp; } } },xaml,windows-phone-7,windows-phone-8,contacts,Xaml,Windows Phone 7,Windows Phone 8,Contacts,我可以使用以下代码获取联系人的照片,请尝试此操作 Contact con; private void contactListBox_Tap(object sender, System.Windows.Input.GestureEventArgs e) { con = ((sender as ListBox).SelectedValue as Contact); BitmapImage img = new BitmapImage();

我可以使用以下代码获取联系人的照片,请尝试此操作

    Contact con;
    private void contactListBox_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        con = ((sender as ListBox).SelectedValue as Contact);

        BitmapImage img = new BitmapImage();
        img.SetSource(con.GetPicture());
        ContactImage.Source = img;
    }

希望对您有所帮助。

使用ItemsControl和包含图像控件的ItemTemplate。好的。我有这个xaml代码,下一步是什么?下一步是阅读一些关于数据模板和数据绑定到集合的在线文档。我们不是来教你们如何一步一步地解决你们的问题的。选民们,你们们能补充一下你们们的意见吗?为什么你们们否决了我的答案?我得到了答案,不知道你为什么投了反对票?