public OptionsWindow(OptionsWindowViewModel viewModel) { this.DataContext = viewModel; viewModel.CloseEvent += (sender, e) => this.Close(); InitializeComponent(); }
public void ShowDialog(OptionsWindowViewModel viewModel) { var window = new OptionsWindow(viewModel); window.Owner = App.Current.MainWindow; window.ShowDialog(); }
public OptionsWindow(OptionsWindowViewModel viewModel) { this.DataContext = viewModel; viewModel.CloseEvent += (sender, e) => this.Close(); InitializeComponent(); this.MouseLeftButtonDown += (sender, e) => this.DragMove(); }
private void Options() { if (_isRunning_Options) { return; } _isRunning_Options = true; ProgressCircleService.Instance.Increment(); Task.Run(() => { var options = OptionsUtils.GetOptions(_amoebaInterfaceManager); ProgressCircleService.Instance.Decrement(); App.Current.Dispatcher.Invoke(() => { var viewModel = new OptionsWindowViewModel(options, _dialogService); viewModel.Callback += (result) => { ProgressCircleService.Instance.Increment(); Task.Run(() => { OptionsUtils.SetOptions(result, _amoebaInterfaceManager, _dialogService); ProgressCircleService.Instance.Decrement(); }); }; viewModel.CloseEvent += (sender, e) => _isRunning_Options = false; _dialogService.ShowDialog(viewModel); }); }); }