Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }