Пример #1
0
        private void AddDoc(object sender, RoutedEventArgs e)
        {
            DocFormAdd docFormAdd = new DocFormAdd();

            docFormAdd.ShowDialog();
            UpdateList();
        }
Пример #2
0
        private void UpdateDoc(object sender, RoutedEventArgs e)
        {
            DocList = new ObservableCollection <DocClass>();
            DocFormAdd docFormAdd = new DocFormAdd((sender as Button).Tag.ToString());

            docFormAdd.ShowDialog();
            bw                     = new BackgroundWorker();
            this.IsEnabled         = false;
            DocListView.Visibility = Visibility.Hidden;
            wait.Opacity           = 1;
            bw.DoWork             += (obj, ea) =>
            {
                UpdateList();
            };
            bw.RunWorkerAsync();
            bw.RunWorkerCompleted += (obj, ea) =>
            {
                wait.Opacity            = 0;
                this.IsEnabled          = true;
                DocListView.Visibility  = Visibility.Visible;
                DocListView.ItemsSource = DocList;
            };
        }