Exemplo n.º 1
0
        private void FieldPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (_isLocked)
            {
                return;
            }

            _wlcTool = ToolFactory.NewWLCTool();

            _toolParameter = new BindingList <IToolParameter>(_wlcTool.ToolParameterContainer.ToolParameter);


            if (_selectedFeature.Fields.Count(f => f.IsSelected) >= 1)
            {
                _wlcTool.Run();

                _wlcResultDataTable = _wlcTool.Data;
            }

            RegisterToolParameterEvents();

            PropertyChanged.Notify(() => WLCParameter);
            PropertyChanged.Notify(() => WLCResult);

            CommandManager.InvalidateRequerySuggested();
        }
Exemplo n.º 2
0
        public WLCToolViewModel()
        {
            _mcdaExtension = MCDAExtension.GetExtension();

            _wlcTool = ToolFactory.NewWLCTool();

            _wlcResultDataTable = _wlcTool.Data;

            _selectedFeaturePropertyChangedEventHandler = _mcdaExtension.RegisterPropertyHandler(x => x.SelectedFeature, SelectedFeaturePropertyChanged);

            //we have to call our own update method to make sure we have a result column
            SelectedFeaturePropertyChanged(this, null);
        }
Exemplo n.º 3
0
        private void SelectedFeaturePropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (_isLocked)
            {
                return;
            }

            _wlcTool = ToolFactory.NewWLCTool();

            _toolParameter = new BindingList <IToolParameter>(_wlcTool.ToolParameterContainer.ToolParameter);

            if (_selectedFeature != null)
            {
                foreach (var currentField in _selectedFeature.Fields)
                {
                    currentField.UnRegisterPropertyHandler(_listOfpropertyChangedEventHandlersForFieldIsSelected);
                }
            }
            _selectedFeature = _mcdaExtension.SelectedFeature;

            if (_selectedFeature != null)
            {
                foreach (var currentField in _selectedFeature.Fields)
                {
                    _listOfpropertyChangedEventHandlersForFieldIsSelected.Add(
                        currentField.RegisterPropertyHandler(f => f.IsSelected, FieldPropertyChanged));
                }

                if (_selectedFeature.Fields.Count(f => f.IsSelected) >= 1)
                {
                    _wlcTool.Run();

                    _wlcResultDataTable = _wlcTool.Data;
                }
            }

            RegisterToolParameterEvents();

            PropertyChanged.Notify(() => WLCParameter);
            PropertyChanged.Notify(() => WLCResult);

            CommandManager.InvalidateRequerySuggested();
        }