using System.Windows.Media.Imaging; public MainPage() { InitializeComponent(); SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape; } private void listBox1_Loaded(object sender, RoutedEventArgs e) { var element = XElement.Load("Data.xml"); var writer = from var in element.Descendants("writer") orderby var.Attribute("writerName").Value select new Authors { writerId = Convert.ToInt32(var.Attribute("writerId").Value), writerName = var.Attribute("writerName").Value, writerImage = GetImage(var.Attribute("writerImage").Value), Description = var.Attribute("Description").Value, Source = new Uri(var.Attribute("Source").Value) }; listBoxwriter.DataContext = writer; } public ImageSource GetImage(string path) { return new BitmapImage(new Uri(path, UriKind.Relative)); }