public BuildIndexFileDialog() { InitializeComponent(); viewModel = new BuildIndexFileViewModel(); DataContext = viewModel; Messenger.Default.Register <bool>(this, viewModel, (result) => { if (IsActive) { DialogResult = result; Close(); } }); Closing += (s, e) => Messenger.Default.Unregister(this);; }
public static void BuildIndexInBackgroundThread(ShapeFileFeatureLayer layer) { BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (sender, arg) => { BuildIndexFileViewModel.BuildIndex(layer); }; worker.RunWorkerCompleted += (sender, arg) => { StatusBar.GetInstance().Visibility = Visibility.Collapsed; System.Windows.Forms.MessageBox.Show(GisEditor.LanguageManager.GetStringResource("BuildIndexFileDialogBuildComletedText")); }; worker.RunWorkerAsync(); StatusBar.GetInstance().Visibility = Visibility.Visible; }