예제 #1
0
        private async void LoadProdutos()
        {
            wb       = new WaitBox();
            wb.Owner = Window.GetWindow(this);
            wb.Show();
            await Task.Run(() =>
            {
                listaProdutos = bll.LoadProdutos();
            });

            lstProdutos.ItemsSource = listaProdutos;
            wb.Close();
        }
예제 #2
0
        public PrecificarProdutos()
        {
            InitializeComponent();

            new Thread(() =>
            {
                Dispatcher.Invoke(new Action(() =>
                {
                    wb       = new WaitBox();
                    wb.Owner = Window.GetWindow(this);
                    wb.Show();
                }));

                syncEvent.Set();
                Dispatcher.Invoke(DispatcherPriority.Background, new Action(() =>
                {
                    listaProdutos = bll.LoadProdutos();
                    t1            = new Thread(WaitLoad);
                    t1.Start();
                }));
            }).Start();
        }