void wc_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e) { // throw new NotImplementedException(); //string xmlData = Encoding.ASCII.GetString(e.Result); MemoryStream ms = new MemoryStream(e.Result); try { bkData = new BookXmlData(ms); Binding bind = new Binding(); bind.Source = bkData; bind.Path = new PropertyPath("Entry"); listBox.SetBinding(ListBox.ItemsSourceProperty, bind); } catch (Exception err) { Debug.Assert(false); } int i = 4343; }
public MainWindow() { InitializeComponent(); BookXmlData bkData = null; try { bkData = new BookXmlData("..\\..\\srch.xml"); Binding bind = new Binding(); bind.Source = bkData; bind.Path = new PropertyPath("Entry"); //listBox.ItemsSource = bind; listBox.SetBinding(ListBox.ItemsSourceProperty, bind); } catch(Exception e) { Debug.Assert(false); } int i = 545; }