示例#1
0
        public OptionsWindow(OptionsWindowViewModel viewModel)
        {
            this.DataContext      = viewModel;
            viewModel.CloseEvent += (sender, e) => this.Close();

            InitializeComponent();
        }
示例#2
0
        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();
        }
示例#4
0
        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);
                });
            });
        }