bool _isChangingConfig = false; // Prevents reentrancy, and command being run twice. Use when adding/changing items.

        #endregion Fields

        #region Constructors

        internal ConfigurationEditorWindowViewModel( ConfigurationEditorWindow parentWindow, IConfigurationManager configManager, LabStateManager serviceManager )
        {
            Debug.Assert( configManager != null );
            Debug.Assert( serviceManager != null );

            _configurationManager = configManager;
            _serviceInfoManager = serviceManager;
            _window = parentWindow;

            _addLayerCommand = new RelayCommand( ExecuteAddLayer );
            _removeLayerCommand = new RelayCommand( ExecuteRemoveLayer );
            _addConfigItemCommand = new RelayCommand( ExecuteAddConfigItem );
            _removeConfigItemCommand = new RelayCommand( ExecuteRemoveConfigItem );
            _setConfigItemStatusCommand = new RelayCommand( ExecuteSetConfigItemStatus );
            _clearOptionalItemsCommand = new RelayCommand( ExecuteClearOptionalItems );
        }
Exemplo n.º 2
0
        private void OpenConfigurationEditorExecute( object param )
        {
            Debug.Assert( param == null || param is Window );
            if( _activeConfEditorWindow != null )
            {
                _activeConfEditorWindow.Activate();
            }
            else
            {
                _activeConfEditorWindow = new ConfigurationEditorWindow( ConfigurationManager, LabState );
                _activeConfEditorWindow.Owner = (Window)param;
                _activeConfEditorWindow.Closing += ( s, e2 ) => { _activeConfEditorWindow = null; };

                _activeConfEditorWindow.Show();
            }
        }