public override void InitializeBinding() { base.InitializeBinding(); _screenBinder.Bind(item => item.FormulaString) .To(txtFormulaString) .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetFormulaString(e.NewValue)); RegisterValidationFor(_screenBinder, NotifyViewChanged); txtFormulaString.TextChanged += (o, e) => OnEvent(formulaStringChanging, e); ReadOnly = false; }
public override void InitializeBinding() { base.InitializeBinding(); _screenBinder.Bind(item => item.FormulaString) .To(txtFormulaString) .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetFormulaString(e.NewValue, e.OldValue)); _colAlias = _gridBinder.Bind(x => x.Alias) .WithOnValueUpdating((formulaUsablePathDTO, e) => OnEvent(() => _presenter.SetAlias(e.NewValue, e.OldValue, formulaUsablePathDTO.FormulaUsablePath))) .WithToolTip(ToolTips.Formula.ReferenceAlias); _colPath = _gridBinder.Bind(x => x.Path) .WithOnValueUpdating((dto, e) => OnEvent(() => _presenter.SetFormulaUsablePath(e.NewValue, dto))) .WithToolTip(ToolTips.Formula.ReferencePath); _colDimension = _gridBinder.Bind(x => x.Dimension) .WithRepository(dto => createDimensionRepository()) .WithOnValueUpdating((formulaUsablePathDTO, e) => OnEvent(() => _presenter.SetFormulaPathDimension(e.NewValue, e.OldValue, formulaUsablePathDTO))) .WithToolTip(ToolTips.Formula.ReferenceDimension); _colRemoveButton = _gridBinder.AddUnboundColumn() .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN) .WithShowButton(ShowButtonModeEnum.ShowAlways) .WithRepository(dto => _removeButtonRepository) .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH); _colAddButton = _gridBinder.AddUnboundColumn() .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN) .WithShowButton(ShowButtonModeEnum.ShowAlways) .WithRepository(dto => _addButtonRepository) .WithFixedWidth((OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH)); _removeButtonRepository.ButtonClick += (o, e) => OnEvent(removeFormulaUsablePath, _gridBinder.FocusedElement); _addButtonRepository.ButtonClick += (o, e) => OnEvent(cloneFormulaUsablePath, _gridBinder.FocusedElement); RegisterValidationFor(_screenBinder, NotifyViewChanged); ReadOnly = false; gridViewReferencePaths.MouseDown += (o, e) => OnEvent(() => onGridViewMouseDown(e)); grdObjectPaths.DragDrop += (o, e) => OnEvent(onDragDrop, e); grdObjectPaths.DragOver += (o, e) => OnEvent(onDragOver, e); DragDrop += (o, e) => OnEvent(onDragDrop, e); DragOver += (o, e) => OnEvent(onDragOver, e); }